From f78a7227ada991ded4ec1e8e58adcf5679252536 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Wed, 27 Jul 2016 14:29:25 +0200 Subject: [PATCH] only add client key if non-null --- Parse/src/main/java/com/parse/ParsePlugins.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Parse/src/main/java/com/parse/ParsePlugins.java b/Parse/src/main/java/com/parse/ParsePlugins.java index d15515e27..4ab874fcc 100644 --- a/Parse/src/main/java/com/parse/ParsePlugins.java +++ b/Parse/src/main/java/com/parse/ParsePlugins.java @@ -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, @@ -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()); } });