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

only add client key if non-null #506

Merged
merged 1 commit into from
Mar 8, 2017
Merged
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
5 changes: 4 additions & 1 deletion Parse/src/main/java/com/parse/ParsePlugins.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public ParseHttpResponse intercept(Chain chain) throws IOException {
ParseHttpRequest request = chain.getRequest();
ParseHttpRequest.Builder builder = new ParseHttpRequest.Builder(request)
.addHeader(ParseRESTCommand.HEADER_APPLICATION_ID, applicationId)
.addHeader(ParseRESTCommand.HEADER_CLIENT_KEY, clientKey)
.addHeader(ParseRESTCommand.HEADER_CLIENT_VERSION, Parse.externalVersionName())
.addHeader(
ParseRESTCommand.HEADER_APP_BUILD_VERSION,
Expand All @@ -112,6 +111,10 @@ public ParseHttpResponse intercept(Chain chain) throws IOException {
// NETWORK_EXECUTOR
builder.addHeader(ParseRESTCommand.HEADER_INSTALLATION_ID, installationId().get());
}
// client key can be null with self-hosted Parse Server
if (clientKey != null) {
builder.addHeader(ParseRESTCommand.HEADER_CLIENT_KEY, clientKey);
}
return chain.proceed(builder.build());
}
});
Expand Down