Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept HTTP 201 response codes #686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/runtimes/worker/auth/fetch_auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var fetchAuth: AuthTransport = function(
return fetch(request)
.then(response => {
let { status } = response;
if (status === 200) {
if (status === 200 || status === 201) {
// manually parse the json so we can provide a more helpful error in
// failure case
return response.text();
Expand All @@ -56,7 +56,7 @@ var fetchAuth: AuthTransport = function(
} catch (e) {
throw new HTTPAuthError(
200,
`JSON returned from ${authRequestType.toString()} endpoint was invalid, yet status code was 200. Data was: ${data}`
`JSON returned from ${authRequestType.toString()} endpoint was invalid. Data was: ${data}`
);
}
callback(null, parsedData);
Expand Down