You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, WebOb converts relative URI to absolute before sending the response. It is done when using HTTPFound, HTTPMovedPermanently exceptions or when using Response with Location header.
Here are pieces of code which demonstrate that. This code is not using any web server. It is pure Python WSGI reference implementation
from wsgiref.util import setup_testing_defaults
from wsgiref.simple_server import make_server
from webob import Response
def app(environ, start_response):
headers = [('Location', './new_page')]
r = Response("redirected", status=301, headers=headers)
return r(environ, start_response)
httpd = make_server('', 8000, app)
httpd.serve_forever()
from wsgiref.util import setup_testing_defaults
from wsgiref.simple_server import make_server
from webob.exc import HTTPMovedPermanently
def app(environ, start_response):
r = HTTPMovedPermanently(location='./new_page')
return r(environ, start_response)
httpd = make_server('', 8000, app)
httpd.serve_forever()
The text was updated successfully, but these errors were encountered:
RFC 7231 allows for relative URI in the redirection response: https://tools.ietf.org/html/rfc7231#section-7.1.2
However, WebOb converts relative URI to absolute before sending the response. It is done when using HTTPFound, HTTPMovedPermanently exceptions or when using Response with Location header.
Here are pieces of code which demonstrate that. This code is not using any web server. It is pure Python WSGI reference implementation
The text was updated successfully, but these errors were encountered: