mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 19:39:25 +08:00
Refactor auth handling in HTTP request functions
Removed redundant AuthModel parameter from sendHttpRequest and streamHttpRequest functions, now using authModel from HttpRequestModel directly. Updated all usages, tests, and related logic to reflect this change. Improved streaming response handling in CollectionStateNotifier and HttpResponseModel.
This commit is contained in:
@@ -158,7 +158,6 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequestV1(
|
||||
Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
|
||||
String requestId,
|
||||
APIType apiType,
|
||||
AuthModel? authData,
|
||||
HttpRequestModel requestModel, {
|
||||
SupportedUriSchemes defaultUriScheme = kDefaultUriScheme,
|
||||
bool noSSL = false,
|
||||
@@ -166,7 +165,6 @@ Future<(HttpResponse?, Duration?, String?)> sendHttpRequest(
|
||||
final stream = await streamHttpRequest(
|
||||
requestId,
|
||||
apiType,
|
||||
authData,
|
||||
requestModel,
|
||||
defaultUriScheme: defaultUriScheme,
|
||||
noSSL: noSSL,
|
||||
@@ -206,11 +204,11 @@ http.Request prepareHttpRequest({
|
||||
Future<Stream<HttpStreamOutput>> streamHttpRequest(
|
||||
String requestId,
|
||||
APIType apiType,
|
||||
AuthModel? authData,
|
||||
HttpRequestModel httpRequestModel, {
|
||||
SupportedUriSchemes defaultUriScheme = kDefaultUriScheme,
|
||||
bool noSSL = false,
|
||||
}) async {
|
||||
final authData = httpRequestModel.authModel;
|
||||
final controller = StreamController<HttpStreamOutput>();
|
||||
StreamSubscription<List<int>?>? subscription;
|
||||
final stopwatch = Stopwatch()..start();
|
||||
|
||||
Reference in New Issue
Block a user