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

implement config.host and config.hostHeader #259

Merged
merged 5 commits into from
Dec 11, 2020
Merged

implement config.host and config.hostHeader #259

merged 5 commits into from
Dec 11, 2020

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Dec 11, 2020

ref #207. This implements a new config.host option which overrides req.headers.host on the server and location.host in the client. This is particularly useful in the context of prerendering, where there's no such thing as req.headers.host because there's no req.

TODO: implement config.hostHeader, allowing host to be controlled by e.g. req.headers['x-forwarded-host']

@benmccann
Copy link
Member

I think most of the adapters will need to be updated as well?

host: null, // TODO

@Rich-Harris
Copy link
Member Author

Maybe not, actually — I think it can all be done inside the renderer itself, meaning it doesn't need to be part of the request object passed to the renderer

@benmccann
Copy link
Member

we'll have to at least remove the TODOs in that case 😄

@Rich-Harris Rich-Harris changed the title implement config.host implement config.host and config.hostHeader Dec 11, 2020
@Rich-Harris Rich-Harris merged commit d992d3b into master Dec 11, 2020
@Rich-Harris Rich-Harris deleted the gh-207 branch December 11, 2020 05:23
@Rich-Harris Rich-Harris mentioned this pull request Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants