-
Notifications
You must be signed in to change notification settings - Fork 67
req.headers.host is undefined on netlify deployment #40
Comments
Hi @s-kris, thanks for posting the issue! Hmm, you are right. I just tested with a plain Netlify Function to see what information is available: exports.handler = function (event, context, callback) {
callback(null, {
statusCode: 200,
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({
event,
context,
}),
});
}; See results here: https://next-on-functions.netlify.app/.netlify/functions/print Seems like host is available on I'll let you know when it's done! 🔥 |
Awesome, thank you @FinnWoelm |
Hi @FinnWoelm, do you have some updates about it? |
Hi, I open a really simple PR that solves this issue. I need to do this to my project, just in case my PR be useful to you, I opened the PR. Case not, just close it. |
We are currently running into this issue and it prevents us from using next-on-netlify in production, do you have an ETA when this is going to be merged and released? |
@FinnWoelm can we solve this issue quickly? Our whole business depend on it :) |
Hi all, sorry for the delay in getting this out the door! We were busy refactoring a lot of the codebase last week. @lindsaylevine just merged the fix into PS: We are super excited that @lindsaylevine has joined Netlify and the |
@FinnWoelm @lindsaylevine That's great to hear. Looking forward to new major features. (hint: pure next-inc-ssg support) |
Just wanted to add here that I added the 'host' header to the multiValueHeaders object for functions on the netlify-side of things to address this issue. It's currently being deployed but should be live on our regular CDN and will be live on our Enterprise CDN soon. |
I'm trying to read the host in getServerSideProps. It works in local environment with
next dev (obviously)
next build && netlify dev
However when deployed on netlify with this plugin,
req.headers.host is undefined. Any info on this? Thank you.
The text was updated successfully, but these errors were encountered: