Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 9fe822a

Browse files
author
josebarrueta
committed
1207 Add client request heade to defaultDataStore.
1 parent 18149e4 commit 9fe822a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

impl/src/main/java/com/stormpath/sdk/impl/ds/DefaultDataStore.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import java.util.TreeMap;
7575

7676
import static com.stormpath.sdk.impl.http.HttpHeaders.STORMPATH_AGENT;
77+
import static com.stormpath.sdk.impl.http.HttpHeaders.STORMPATH_CLIENT_REQUEST_ID;
7778

7879
/**
7980
* @since 0.1
@@ -630,6 +631,11 @@ protected void applyDefaultRequestHeaders(Request request) {
630631
request.getHeaders().setContentType(MediaType.APPLICATION_JSON);
631632
}
632633
}
634+
635+
List<String> clientRequestId;
636+
if (headerMap != null && ((clientRequestId = headerMap.get(STORMPATH_CLIENT_REQUEST_ID)) != null)) {
637+
request.getHeaders().put(STORMPATH_CLIENT_REQUEST_ID, clientRequestId);
638+
}
633639
}
634640

635641
protected CanonicalUri canonicalize(String href, Map<String,?> queryParams) {

impl/src/main/java/com/stormpath/sdk/impl/http/HttpHeaders.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public class HttpHeaders implements MultiValueMap<String, String> {
7878

7979
public static final String STORMPATH_AGENT = "X-Stormpath-Agent";
8080

81+
public static final String STORMPATH_CLIENT_REQUEST_ID = "X-Stormapth-Client-Request-Id";
82+
8183
private static final String[] DATE_FORMATS = new String[]{
8284
"EEE, dd MMM yyyy HH:mm:ss zzz",
8385
"EEE, dd-MMM-yy HH:mm:ss zzz",

0 commit comments

Comments
 (0)