Skip to content

Commit 4f9b728

Browse files
committed
Merge pull request #6 from amohanse/master
Fix for x-ms-date format issue with SDF in GatewayProxy.java
2 parents b17d280 + 6da2016 commit 4f9b728

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/com/microsoft/azure/documentdb/GatewayProxy.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private HttpClient getHttpClient(boolean isForMedia) {
126126

127127
/**
128128
* Only one instance is created for the httpClient for optimization.
129-
* A PoolingClientConnectionManager is used with the Http client
129+
* A PoolingClientConnectionManager is used with the Http client
130130
* to be able to reuse connections and execute requests concurrently.
131131
* A timeout for closing each connection is set so that connections don't leak.
132132
* A timeout is set for requests to avoid deadlocks.
@@ -153,11 +153,11 @@ private void putMoreContentIntoDocumentServiceRequest(
153153
String httpMethod) {
154154
if (this.masterKey != null) {
155155
final Date currentTime = new Date();
156-
final SimpleDateFormat sdf =
157-
new SimpleDateFormat("E, dd MMM YYY HH:mm:ss z");
156+
final SimpleDateFormat sdf =
157+
new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
158158
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
159159
String xDate = sdf.format(currentTime);
160-
160+
161161
request.getHeaders().put(HttpConstants.HttpHeaders.X_DATE, xDate);
162162
}
163163

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

210210
private void maybeThrowException(HttpResponse response) throws DocumentClientException {
211211
int statusCode = response.getStatusLine().getStatusCode();
212-
212+
213213
if (statusCode >= HttpConstants.StatusCodes.MINIMUM_STATUSCODE_AS_ERROR_GATEWAY) {
214214
HttpEntity httpEntity = response.getEntity();
215215
String body = "";
@@ -263,7 +263,7 @@ private DocumentServiceResponse performDeleteRequest(
263263
}
264264

265265
this.maybeThrowException(response);
266-
266+
267267
// No content in delete request, we can release the connection directly;
268268
httpDelete.releaseConnection();
269269
return new DocumentServiceResponse(response);
@@ -282,7 +282,7 @@ private DocumentServiceResponse performGetRequest(DocumentServiceRequest request
282282
null, // Query string not used.
283283
null);
284284
} catch (URISyntaxException e) {
285-
throw new IllegalArgumentException("Incorrect uri from request.",
285+
throw new IllegalArgumentException("Incorrect uri from request.",
286286
e);
287287
}
288288

0 commit comments

Comments
 (0)