-
Notifications
You must be signed in to change notification settings - Fork 231
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
Forwarded event fetch request having double headers in Nuxt/SEO module (triggered in server middleware) #956
Comments
On my end it looks like it's caused by a workaround I did for the bug fixed in: #946 I can remove my workaround but that will break earlier versions so probably better to merge them correctly. |
Actually I think this is a bug purely on the Sitemap module using Will move discussion to nuxt-modules/sitemap#400 |
Yea, sorry couldn't debug it properly. Goes too deep into some very internal logic there |
I'm not convinced of my above point either now actually, no idea 🤷 Will track in sitemap for now |
Ok, i'll try to debug it today and will report the results. |
This would likely fix it but I'm concerned it may introduce regressions nuxt-modules/sitemap#402 |
I ve tracked the headers joined by defu and it's simple:
So i don't really see an issue here with this. I'll try to track whats happening on the h3 side |
@harlan-zw OK i think i've found what the issue is Headers are both capitalized Host and lowercase host As you can see the new h3 addition getProxyRequestHeaders return the lowercase localhost and yours event fetch init code adds the capitalized Host. It's a giant side effect of the whole pipeline. Now not sure if sitemap module needs uppercase Host or should the h3 change the logic regarding the joining of headers for the host parameter. Hope this helps |
Fixed downstream |
Environment
node 20
mac m3
Reproduction
Connected all the dots
Describe the bug
On the receiving API
Invalid URL
Breaks with
while using event as a fetchContainer
on
getRequestURL
where the vars are:
the double "localhost:3000, localhost:3000" shouldn't be there I guess
Also this error only happens in nuxt server middleware when getRequestURL is called
https://github.com/unjs/h3/pull/946/files
I believe the change above introduced such issue
Not really sure if this is the upstream issue but tnx again for taking a look!
Additional context
Logs
The text was updated successfully, but these errors were encountered: