Use HTTP code 307 for redirects
Changed HTTP redirect code from 302 to 307 to ensure the original HTTP method is left intact. Otherwise some clients may change PUT/POST to GET on redirect and effectively fail to perform the change they intended. Change-Id: I32613e1ebb4a2eaba33c5884ddbd3ec7cf77d6fd Story: 2005370 Task: 30346
This commit is contained in:
parent
caa0593a9c
commit
adc16921b4
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Changed HTTP redirect code from 302 to 307 to ensure the
|
||||
original HTTP method is left intact. Otherwise some clients
|
||||
may change PUT/POST to GET on redirect and effectively fail
|
||||
to perform the change they intended.
|
@ -126,7 +126,7 @@ def returns_json(decorated_func):
|
||||
def all_exception_handler(message):
|
||||
if isinstance(message, error.AliasAccessError):
|
||||
url = flask.url_for(flask.request.endpoint, identity=message.args[0])
|
||||
return flask.redirect(url, Response=flask.Response)
|
||||
return flask.redirect(url, code=307, Response=flask.Response)
|
||||
return flask.render_template('error.json', message=message), 500
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user