Azure / Azure/azure-functions-host
HttpRequest.Headers.TryGetValue Encoding Bug.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
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
Contributor guide
Research direction
Start by reproducing the difference between local development and the Azure Function server using HttpRequest.Headers.TryGetValue and the client's TryAddWithoutValidation call. Compare how the Japanese or Korean header value is represented in each environment; done means the encoding discrepancy is explained and the request header is handled correctly on Azure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100