1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00
Former-commit-id: f8560514a7b48f83121ddd21d74b4016af4e1b67
This commit is contained in:
Gerasimos Maropoulos
2018-03-08 20:55:58 +02:00
parent 83c4b7f52d
commit 1165b4527a
4 changed files with 13 additions and 6 deletions

View File

@@ -172,6 +172,14 @@ func (h *routerHandler) HandleRequest(ctx context.Context) {
r.URL.Path = path
url := r.URL.String()
// Fixes https://github.com/kataras/iris/issues/921
// This is caused for security reasons, imagine a payment shop,
// you can't just permantly redirect a POST request, so just 307 (RFC 7231, 6.4.7).
if method == http.MethodPost || method == http.MethodPut {
ctx.Redirect(url, http.StatusTemporaryRedirect)
return
}
ctx.Redirect(url, http.StatusMovedPermanently)
// RFC2616 recommends that a short note "SHOULD" be included in the