-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from ArunPrakashG/feature/execute-middleware
[FEATURE] Execution Middleware Override
- Loading branch information
Showing
12 changed files
with
128 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
const Duration kDefaultRequestTimeout = Duration(seconds: 30); | ||
const Duration DEFAULT_REQUEST_TIMEOUT = Duration(seconds: 30); | ||
const String MIDDLEWARE_HEADER_KEY = 'X-Local-Middleware'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export 'delegated_middleware.dart'; | ||
export 'models/middleware_raw_response.dart'; | ||
export 'wordpress_middleware_base.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
final class MiddlewareRawResponse { | ||
const MiddlewareRawResponse({ | ||
required this.statusCode, | ||
required this.body, | ||
this.message, | ||
this.headers, | ||
this.extra, | ||
}); | ||
|
||
factory MiddlewareRawResponse.defaultInstance() { | ||
return const MiddlewareRawResponse(statusCode: -99, body: null); | ||
} | ||
|
||
final int statusCode; | ||
final Map<String, dynamic>? headers; | ||
final Map<String, dynamic>? extra; | ||
final dynamic body; | ||
final String? message; | ||
|
||
bool get hasData => body != null && statusCode >= 200 && statusCode < 300; | ||
|
||
@override | ||
String toString() { | ||
return 'MiddlewareRawResponse(statusCode: $statusCode, headers: $headers, body: $body, message: $message, extra: $extra)'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters