Skip to content

Commit

Permalink
set Authorization header only when we have data for it
Browse files Browse the repository at this point in the history
  • Loading branch information
doom369 committed Feb 4, 2020
1 parent febdb57 commit 195816a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ private HttpURLConnection buildConnection(URI uri) throws ClickHouseException {
}

private void setDefaultHeaders(HttpURLConnection connection) {
connection.addRequestProperty("Authorization", properties.getHttpAuthorization());
String httpAuthorization = properties.getHttpAuthorization();
if (httpAuthorization != null) {
connection.addRequestProperty("Authorization", httpAuthorization);
}
connection.addRequestProperty("Content-Type", "text/plain; charset=UTF-8");
}

Expand Down

0 comments on commit 195816a

Please sign in to comment.