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

Values ​​sent by headers in the middleware are not accepting letters with accents #65083

Open
1 task done
Wilian-Pereira-W opened this issue Apr 26, 2024 · 2 comments
Open
1 task done
Labels
examples Issue/PR related to examples

Comments

@Wilian-Pereira-W
Copy link

Wilian-Pereira-W commented Apr 26, 2024

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Version: ubuntu 22.04.4 lts
Binaries:
  Node: 21.7.3
  Yarn: 1.22.19
Relevant Packages:
  next: 14.0.3
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5

Which example does this report relate to?

Runtime

What browser are you using? (if relevant)

next dev (local), build and production

How are you deploying your application? (if relevant)

No response

Describe the Bug

Values ​​sent by headers in the middleware are not accepting letters with accents. Example: headers.set(test, à preço);
But the get headers show test: 'à preço'

bug

Expected Behavior

Result should be test: "à". In the network headers, but "Ã" appears.

To Reproduce

Use headers.set() in a route in the middleware and check the headers value in the page's network. Ex: headers.set("test", "à") in the network should show test: "à" and not "Ã".

@Wilian-Pereira-W Wilian-Pereira-W added the examples Issue/PR related to examples label Apr 26, 2024
@ByronKweh
Copy link

Hi @Wilian-Pereira-W ! just investigated your problem. This is not a problem with Next.js but instead a problem with the browser, ran a few example of unit test with the setHeaders in the next response and all was fine. To reproduce this issue without next to prove that it's actually from Chrome, you can use requestly and set a custom header for any url and you will see it parse to 'à preço' as well.

@Wilian-Pereira-W
Copy link
Author

Hi @ByronKweh But when it is in the page route the header value works perfectly, when I use the app route the headers information does not work the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Issue/PR related to examples
Projects
None yet
Development

No branches or pull requests

2 participants