mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-04-25 22:29:49 +08:00
Merge pull request #745 from Pandaver/fix-non-ascii-report-server-name
fix: URL encode report server name to support non-ASCII characters (#744)
This commit is contained in:
@@ -94,7 +94,9 @@ class ReportServerInterceptor extends Interceptor {
|
||||
// Set headers
|
||||
final matchedRule = server.name;
|
||||
if (matchedRule.isNotEmpty) {
|
||||
ioReq.headers.set('X-Report-Name', matchedRule);
|
||||
// URL encode the server name to support non-ASCII characters (e.g., Chinese)
|
||||
final encodedName = Uri.encodeComponent(matchedRule);
|
||||
ioReq.headers.set('X-Report-Name', encodedName);
|
||||
}
|
||||
|
||||
ioReq.headers.set(HttpHeaders.contentTypeHeader, 'application/json; charset=utf-8');
|
||||
|
||||
Reference in New Issue
Block a user