mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
fix http
This commit is contained in:
@@ -218,14 +218,14 @@ class RHttpAdapter implements HttpClientAdapter {
|
||||
rhttp.ClientSettings settings;
|
||||
|
||||
RHttpAdapter(this.settings) {
|
||||
settings.copyWith(
|
||||
settings = settings.copyWith(
|
||||
redirectSettings: const rhttp.RedirectSettings.limited(5),
|
||||
timeoutSettings: const rhttp.TimeoutSettings(
|
||||
connectTimeout: Duration(seconds: 15),
|
||||
keepAliveTimeout: Duration(seconds: 60),
|
||||
keepAlivePing: Duration(seconds: 30),
|
||||
),
|
||||
httpVersionPref: rhttp.HttpVersionPref.http1_1,
|
||||
throwOnStatusCode: false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -275,12 +275,7 @@ class RHttpAdapter implements HttpClientAdapter {
|
||||
var data = res.body;
|
||||
if(headers['content-encoding']?.contains('gzip') ?? false) {
|
||||
// rhttp does not support gzip decoding
|
||||
var buffer = <int>[];
|
||||
await for (var chunk in data) {
|
||||
buffer.addAll(chunk);
|
||||
}
|
||||
data = Stream.value(Uint8List.fromList(gzip.decode(buffer)));
|
||||
buffer.clear();
|
||||
data = gzip.decoder.bind(data).map((data) => Uint8List.fromList(data));
|
||||
}
|
||||
return ResponseBody(
|
||||
data,
|
||||
|
Reference in New Issue
Block a user