Skip to content

Commit 64e74dc

Browse files
authored
Merge pull request #506 from posativ/patch-1
only add client key if non-null
2 parents fe08345 + f78a722 commit 64e74dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Parse/src/main/java/com/parse/ParsePlugins.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public ParseHttpResponse intercept(Chain chain) throws IOException {
9595
ParseHttpRequest request = chain.getRequest();
9696
ParseHttpRequest.Builder builder = new ParseHttpRequest.Builder(request)
9797
.addHeader(ParseRESTCommand.HEADER_APPLICATION_ID, applicationId)
98-
.addHeader(ParseRESTCommand.HEADER_CLIENT_KEY, clientKey)
9998
.addHeader(ParseRESTCommand.HEADER_CLIENT_VERSION, Parse.externalVersionName())
10099
.addHeader(
101100
ParseRESTCommand.HEADER_APP_BUILD_VERSION,
@@ -112,6 +111,10 @@ public ParseHttpResponse intercept(Chain chain) throws IOException {
112111
// NETWORK_EXECUTOR
113112
builder.addHeader(ParseRESTCommand.HEADER_INSTALLATION_ID, installationId().get());
114113
}
114+
// client key can be null with self-hosted Parse Server
115+
if (clientKey != null) {
116+
builder.addHeader(ParseRESTCommand.HEADER_CLIENT_KEY, clientKey);
117+
}
115118
return chain.proceed(builder.build());
116119
}
117120
});

0 commit comments

Comments
 (0)