Skip to content
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
14 changes: 7 additions & 7 deletions src/com/microsoft/azure/documentdb/GatewayProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private HttpClient getHttpClient(boolean isForMedia) {

/**
* Only one instance is created for the httpClient for optimization.
* A PoolingClientConnectionManager is used with the Http client
* A PoolingClientConnectionManager is used with the Http client
* to be able to reuse connections and execute requests concurrently.
* A timeout for closing each connection is set so that connections don't leak.
* A timeout is set for requests to avoid deadlocks.
Expand All @@ -153,11 +153,11 @@ private void putMoreContentIntoDocumentServiceRequest(
String httpMethod) {
if (this.masterKey != null) {
final Date currentTime = new Date();
final SimpleDateFormat sdf =
new SimpleDateFormat("E, dd MMM YYY HH:mm:ss z");
final SimpleDateFormat sdf =
new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
String xDate = sdf.format(currentTime);

request.getHeaders().put(HttpConstants.HttpHeaders.X_DATE, xDate);
}

Expand Down Expand Up @@ -209,7 +209,7 @@ private void fillHttpRequestBaseWithHeaders(Map<String, String> headers, HttpReq

private void maybeThrowException(HttpResponse response) throws DocumentClientException {
int statusCode = response.getStatusLine().getStatusCode();

if (statusCode >= HttpConstants.StatusCodes.MINIMUM_STATUSCODE_AS_ERROR_GATEWAY) {
HttpEntity httpEntity = response.getEntity();
String body = "";
Expand Down Expand Up @@ -263,7 +263,7 @@ private DocumentServiceResponse performDeleteRequest(
}

this.maybeThrowException(response);

// No content in delete request, we can release the connection directly;
httpDelete.releaseConnection();
return new DocumentServiceResponse(response);
Expand All @@ -282,7 +282,7 @@ private DocumentServiceResponse performGetRequest(DocumentServiceRequest request
null, // Query string not used.
null);
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Incorrect uri from request.",
throw new IllegalArgumentException("Incorrect uri from request.",
e);
}

Expand Down