Skip to content

Commit

Permalink
Accept 201 status code from auth endpoints
Browse files Browse the repository at this point in the history
While strictly incorrect (201 describes the creation of a new HTTP
resource, the URI of which is reported in the Location header), some
other client libraries have long accepted 201 responses, and people have
tested their implementations only with such libraries.
  • Loading branch information
mdpye committed Sep 28, 2016
1 parent d46b30b commit 5c63008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/pusher/client/util/HttpAuthorizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public String authorize(final String channelName, final String socketId) throws
rd.close();

final int responseHttpStatus = connection.getResponseCode();
if (responseHttpStatus != 200) {
if (responseHttpStatus != 200 && responseHttpStatus != 201) {
throw new AuthorizationFailureException(response.toString());
}

Expand Down

0 comments on commit 5c63008

Please sign in to comment.