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

Fetch fails when guest content set Host header. #145

Open
karthik2804 opened this issue Sep 19, 2024 · 3 comments
Open

Fetch fails when guest content set Host header. #145

karthik2804 opened this issue Sep 19, 2024 · 3 comments

Comments

@karthik2804
Copy link
Contributor

karthik2804 commented Sep 19, 2024

When the guest content sets the Host header, it fails with the following error

 Error: Failed to clone headers 

This is because' Host' is a forbidden header in the wasi-http spec. I believe that this was fixed a while back where the engine would remove the host header but it seems to have regressed now.

@guybedford
Copy link
Contributor

This may well have regressed in the recent headers work, but this should be a simple fix, I believe what is needed is to add a forbidden headers filter after obtaining the headers list here - https://github.com/bytecodealliance/StarlingMonkey/blob/main/builtins/web/fetch/headers.cpp#L451.

And it would also be good to add a test to avoid future regressions as well.

@karthik2804
Copy link
Contributor Author

I am not entirely sure how the tests work in this repo but I think this is a test that already tracks it(?)

"Host is a forbidden request header": {
"status": "FAIL"

@guybedford
Copy link
Contributor

It may well do, although this has never passed for StarlingMonnkey so that doesn't line up the comment that this was a regression, but however we get coverage is of course fine.

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

No branches or pull requests

2 participants