Skip to content

301 Redirect should handle relative URL in response_headers['location']

Created by: cowlibob

The returned location is used for the next request directly, but in some cases, this can be a relative URL:

An obsolete version of the HTTP 1.1 specifications (IETF RFC 2616) required a complete absolute URI for redirection.[2] The IETF HTTP working group found that the most popular web browsers tolerate the passing of a relative URL[3] and, consequently, the updated HTTP 1.1 specifications (IETF RFC 7231) relaxed the original constraint, allowing the use of relative URLs in Location headers.[4] (https://en.wikipedia.org/wiki/HTTP_location)

https://github.com/oauth-xx/oauth2/blob/3bef9feff5de9d46b35c7423061508e5092b1eac/lib/oauth2/client.rb#L113