mirror of
https://github.com/foss42/apidash.git
synced 2025-12-08 14:08:22 +08:00
Merge branch 'foss42:main' into add-feature-oauth-2
This commit is contained in:
@@ -114,7 +114,6 @@ Future<HttpRequestModel> handleAuth(
|
||||
final httpResult = await sendHttpRequest(
|
||||
"digest-${Random.secure()}",
|
||||
APIType.rest,
|
||||
null,
|
||||
httpRequestModel,
|
||||
);
|
||||
final httpResponse = httpResult.$1;
|
||||
|
||||
@@ -50,20 +50,3 @@ Future<http.Response> convertStreamedResponse(
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Stream<String?> streamTextResponse(
|
||||
http.StreamedResponse streamedResponse,
|
||||
) async* {
|
||||
try {
|
||||
if (streamedResponse.statusCode != 200) {
|
||||
final errorText = await streamedResponse.stream.bytesToString();
|
||||
throw Exception('${streamedResponse.statusCode}\n$errorText');
|
||||
}
|
||||
final utf8Stream = streamedResponse.stream.transform(utf8.decoder);
|
||||
await for (final chunk in utf8Stream) {
|
||||
yield chunk;
|
||||
}
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user