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

Lookup route during OPTIONS by using request.info.hostname. Closes #2930 #2931

Merged
merged 1 commit into from Nov 5, 2015

Conversation

@mtharrison
Copy link
Contributor

@mtharrison mtharrison commented Nov 5, 2015

During a normal request the route is looked up using the value of request.info.hostname:

const match = this.connection._router.route(this.method, this.path, this.info.hostname);

However during an OPTIONS request, it's currently being looked up via the value of request.headers.host:

const route = request.connection.match(method, request.path, request.headers.host);

These values are different when not using port 80, therfore this can cause the route not to be found correctly when there's a vhost setting on a route as per hapijs/glue#38 #2930.

@devinivy
Copy link
Member

@devinivy devinivy commented Nov 5, 2015

Thanks for tracking this down– looks good to me.

@hueniverse hueniverse added the bug label Nov 5, 2015
@hueniverse hueniverse self-assigned this Nov 5, 2015
@hueniverse hueniverse added this to the 11.1.1 milestone Nov 5, 2015
hueniverse added a commit that referenced this issue Nov 5, 2015
Lookup route during OPTIONS by using request.info.hostname. Closes #2930
@hueniverse hueniverse merged commit 3bf3874 into hapijs:master Nov 5, 2015
1 check passed
@lock
Copy link

@lock 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants