dart-lang / dart-lang/http

FormatException with non-ASCII header field value in request

Open
#227 21 comments 7 reactions 0 assignees View on GitHub
type-bug type-enhancement
Dominant language
Dart
Stars
1.1k
Forks
419
Avg merge
4d 14h
Merged PRs (30d)
8

Description

Field value containing a non English character is invalid like 'Pétange'.
If changed to 'Petange' is OK.
Any idea ?

` Map _headers = {
'authorization': basicAuth,
'Entity': 'Pétange',
};
http.Response _result =
await _webUtils.get(_url, headers: _headers).then((dynamic res) {
return res;
});`

Error :
**FormatException: Invalid HTTP header field value: "Pétange"**

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the request shown in the issue through _webUtils.get with the `Entity` header set to `Pétange`, then trace where HTTP header values are validated. Determine the expected handling of non-ASCII values and verify the result with a regression test or a documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.