RFC 2616 had at some point an ambiguous statement in it that made it
look like relative URIs was not allowed in the Location header. This RFC is
now outdated and superseded with RFC 7231
Some implementations like Flask implemented their response object
based on this mistake. This ambiguity was later corrected in updated
RFC 7231 but Flask has kept the old implementation. Which means to get
correct standards compliant redirects we need to override the default
responder and tell it not to force absolute URIs.
Former wording of the RFC:
The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource. For 201 (Created) responses, the Location is that of the new resource which was created by the request. For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI. Location = "Location" ":" absoluteURI
Current wording
The "Location" header field is used in some responses to refer to a specific resource in relation to the response. The type of relationship is defined by the combination of request method and status code semantics. Location = URI-reference
[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
[2] https://tools.ietf.org/html/rfc7231#section-7.1.2
I don't quite understand this line but how about:
adhering to a typo the out-dated -> a misunderstanding of an ambiguous statement in a former version of RFC 2616