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

Catch-all routes duplicates custom headers #12419

Open
1 task
zanettin opened this issue Nov 12, 2024 · 2 comments · May be fixed by #12518
Open
1 task

Catch-all routes duplicates custom headers #12419

zanettin opened this issue Nov 12, 2024 · 2 comments · May be fixed by #12518
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@zanettin
Copy link

Astro Info

Astro                    v4.16.10
Node                     v18.20.3
System                   Linux (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

Describe the Bug

Setting a custom header (X-Debug in the attached repro), the values are duplicated when returning a response on the catch-all ([...slug].astro) route.

Reproduction

  • run npm run build && npm run preview
  • open dev tools -> network
  • go to any URI but not home
  • checking X-Debug header which has the value 1234, 1234

What's the expected result?

X-Debug header should have value 1234 also on catch-all routes

Link to Minimal Reproducible Example

https://codesandbox.io/p/devbox/focused-cartwright-hjrw7n?workspaceId=858df2c7-b16d-4601-b40c-e4a00d04da47

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Nov 12, 2024
@ematipico
Copy link
Member

I can't replicate, can you please at least tell us which browser you're using?

Here's what I get on firefox (raw headers)

HTTP/1.1 500 Internal Server Error
Access-Control-Allow-Origin: *
content-type: text/plain;charset=UTF-8
x-debug: 1234
Date: Mon, 18 Nov 2024 14:21:25 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

@ematipico ematipico added the needs response Issue needs response from OP label Nov 18, 2024
@zanettin
Copy link
Author

Thank you very much @ematipico for having a look at this issue and sorry if my description was not clear. i've recorded a short video to demonstrate the point i've tried to mention above. important is, that i am talking about the built version of the app and not the dev mode. since the headers are set on SSR it doesn't have an impact which browser is used. if i can give you further info, please let me know 🙏

2024-11-20.16-43-51.mp4

@ematipico ematipico added - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs response Issue needs response from OP needs triage Issue needs to be triaged labels Nov 25, 2024
@ematipico ematipico linked a pull request Nov 25, 2024 that will close this issue
@ematipico ematipico self-assigned this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants