Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: pkg/oauth2/lib/src/handle_access_token_response.dart

Issue 177093006: Added text/javascript as a possible content-type response to the _validate method (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/oauth2/lib/src/handle_access_token_response.dart
diff --git a/pkg/oauth2/lib/src/handle_access_token_response.dart b/pkg/oauth2/lib/src/handle_access_token_response.dart
index 129f259194bfdb4a61881504fc0b015683c73590..eb219d7a90db46486301f9256882970aa7334c9d 100644
--- a/pkg/oauth2/lib/src/handle_access_token_response.dart
+++ b/pkg/oauth2/lib/src/handle_access_token_response.dart
@@ -34,8 +34,8 @@ Credentials handleAccessTokenResponse(
if (contentType != null) {
contentType = ContentType.parse(contentType);
}
- validate(contentType != null && contentType.value == "application/json",
- 'content-type was "$contentType", expected "application/json"');
+ validate(contentType != null && (contentType.value == "application/json" || contentType.value == "text/javascript"),
+ 'content-type was "$contentType", expected "application/json" or "text/javascript"');
var parameters;
try {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698