Requests with absolute URI in the HTTP request line return 404, but when the request line has a path it works correctly.
Here is an example of a request against a Fastly service with an Amazon S3 backend that works correctly:
GET /registry.ets.gz HTTP/1.1 Host: repo.hex.pm
HTTP clients when making requests to a proxy (without using CONNECT) use an absolute URI in the request line to inform the proxy to which server to connect to and the proxy will forward the request line without rewriting it from absolute URI to path. Example of absolute URI:
GET https://repo.hex.pm/registry.ets.gz HTTP/1.1 Host: repo.hex.pm
Unfortunately Fastly will always return 404 in these cases. RFC 2616 says that absolute URI must be handled by servers:
To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies.
It’s not an issue with Amazon because they correctly handle requests with absolute URI:
GET http://s3.amazonaws.com/s3.hex.pm/registry.ets.gz HTTP/1.1 Host: s3.amazonaws.com
Please sign in to leave a comment.