Add report name to header

This commit is contained in:
wanghongenpin
2025-10-28 14:32:11 +08:00
parent 63cc69e471
commit f6f2f99535
4 changed files with 23 additions and 10 deletions

View File

@@ -92,6 +92,11 @@ class ReportServerInterceptor extends Interceptor {
final ioReq = await httpClient.postUrl(uri).timeout(const Duration(seconds: 5));
// Set headers
final matchedRule = server.name;
if (matchedRule.isNotEmpty) {
ioReq.headers.set('X-Report-Name', matchedRule);
}
ioReq.headers.set(HttpHeaders.contentTypeHeader, 'application/json; charset=utf-8');
if (compression == 'gzip') {
ioReq.headers.set(HttpHeaders.contentEncodingHeader, 'gzip');