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

HttpRequest.Headers.TryGetValue Encoding Bug. #9718

Open
pulmuone opened this issue Dec 4, 2023 · 2 comments
Open

HttpRequest.Headers.TryGetValue Encoding Bug. #9718

pulmuone opened this issue Dec 4, 2023 · 2 comments

Comments

@pulmuone
Copy link

pulmuone commented Dec 4, 2023

When the client enters Japanese or Korean characters in request.Headers.TryAddWithoutValidation and sends them to Azure Funciton, they are converted to strange characters.
However, it is processed normally on the local development PC.
Why does Japanese or Korean look strange only on my Azure Function server?

public static async Task Run([HttpTrigger(AuthorizationLevel.AuthLevelValue, "get", "post", Route = null)]HttpRequest req, TraceWriter log)
{
if(req.Headers.TryGetValue("Team", out var team) )
{
Debug.WriteLine(team) //
}
}

Client Input Value : ラインシステム
Azure Function (Azure Online Server) Debug Result : %C3%A3%C2%83%C2%A9%C3%A3%C2%82%C2%A4%C3%A3%C2%83%C2%B3%C3%A3%C2%82%C2%B7%C3%A3%C2%82%C2%B9%C3%A3%C2%83%C2%86%C3%A3%C2%83%C2%A0

@kshyju
Copy link
Member

kshyju commented Dec 4, 2023

@pulmuone Do you see the same behavior when trying in an aspnet core web api?

@pulmuone
Copy link
Author

pulmuone commented Dec 4, 2023

@kshyju Do you see the same behavior when trying in an aspnet core web api?

It is processed normally in Local Azure Function.
It is processed normally in aspnet core web API.

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