From 5c6300846fb2e0ecb5856874e44e5ee2b6b53144 Mon Sep 17 00:00:00 2001 From: Michael Pye Date: Wed, 28 Sep 2016 09:33:07 +0100 Subject: [PATCH] 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. --- src/main/java/com/pusher/client/util/HttpAuthorizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/pusher/client/util/HttpAuthorizer.java b/src/main/java/com/pusher/client/util/HttpAuthorizer.java index b1af0ff2..bfee012c 100644 --- a/src/main/java/com/pusher/client/util/HttpAuthorizer.java +++ b/src/main/java/com/pusher/client/util/HttpAuthorizer.java @@ -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()); }