Skip to content

Commit 5c63008

Browse files
committed
Accept 201 status code from auth endpoints
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.
1 parent d46b30b commit 5c63008

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/pusher/client/util/HttpAuthorizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public String authorize(final String channelName, final String socketId) throws
138138
rd.close();
139139

140140
final int responseHttpStatus = connection.getResponseCode();
141-
if (responseHttpStatus != 200) {
141+
if (responseHttpStatus != 200 && responseHttpStatus != 201) {
142142
throw new AuthorizationFailureException(response.toString());
143143
}
144144

0 commit comments

Comments
 (0)