Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove special handling of the HTTP Location header #1926

Closed
kanongil opened this issue Sep 10, 2014 · 3 comments
Closed

Remove special handling of the HTTP Location header #1926

kanongil opened this issue Sep 10, 2014 · 3 comments
Assignees
Labels
breaking changes Change that can breaking existing code feature New functionality or improvement
Milestone

Comments

@kanongil
Copy link
Contributor

When reply.redirect() is called with a relative url, the resulting Location header is currently mapped to an absolute url. When coupled with a reverse proxy the hapi logic can result in an incorrect Location header.

Since the proposed https://tools.ietf.org/html/rfc7231#section-7.1.2 allows relative URI references and most agents seem to already support it, would it be possible to disable this rewriting somehow?

@kanongil
Copy link
Contributor Author

I guess this request is somewhat related to the issue behind #1747.

@hueniverse hueniverse added the breaking changes Change that can breaking existing code label Nov 7, 2014
@hueniverse hueniverse added this to the 8.0.0 milestone Nov 7, 2014
@hueniverse hueniverse self-assigned this Nov 7, 2014
@hueniverse
Copy link
Contributor

Given the change in the HTTP 1.1 specification, I no longer see why we need to prefix locations at all. This is a relic from an early version of postmile when HTTP still required absolute URIs. The new specification doesn't even mention this old requirement anymore and all modern browsers support relative locations.

This code has been a huge pain in the ass so will gladly get rid of this crap and let people who want absolute URIs deal with them as they see fit with whatever rules they want. I am sure someone can write a fancy plugin that does this based on some fancy logic.

@hueniverse hueniverse changed the title Allow relative .redirect() response Remove special handling of the HTTP Location header Nov 7, 2014
@Marsup Marsup added feature New functionality or improvement and removed request labels Sep 20, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants