olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From archana...@apache.org
Subject olingo-odata4 git commit: [OLINGO-1179]Copying oDataHeaders from parent call to subsequent calls
Date Wed, 20 Sep 2017 13:29:15 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master 8a968923b -> 379a3c706


[OLINGO-1179]Copying oDataHeaders from parent call to subsequent calls


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/379a3c70
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/379a3c70
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/379a3c70

Branch: refs/heads/master
Commit: 379a3c706ecd7a76e52a6ff98bc647afb75b5abc
Parents: 8a96892
Author: Archana Rai <archana.rai@sap.com>
Authored: Wed Sep 20 18:59:04 2017 +0530
Committer: Archana Rai <archana.rai@sap.com>
Committed: Wed Sep 20 18:59:04 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java    | 1 +
 .../communication/request/retrieve/XMLMetadataRequestImpl.java   | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/379a3c70/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
index b6f9b94..e2b5739 100644
--- a/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/client/BasicITCase.java
@@ -253,6 +253,7 @@ public class BasicITCase extends AbstractParamTecSvcITCase {
 
     final ODataRetrieveResponse<ClientEntitySet> response = request.execute();
     saveCookieHeader(response);
+    assertNotNull(response.getHeaderNames());
     assertEquals(HttpStatusCode.OK.getStatusCode(), response.getStatusCode());
     assertContentType(response.getContentType());
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/379a3c70/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java
b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java
index 22d46ad..c4047c3 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/XMLMetadataRequestImpl.java
@@ -75,6 +75,10 @@ public class XMLMetadataRequestImpl
       final SingleXMLMetadatRequestImpl includeReq = new SingleXMLMetadatRequestImpl(
           odataClient,
           odataClient.newURIBuilder(uri.resolve(reference.getUri()).toASCIIString()).build());
+      // Copying the headers from first request to next request
+      for(String key : rootReq.getHeaderNames()){
+         includeReq.addCustomHeader(key ,rootReq.getHeader(key));
+      }
       final XMLMetadata includeMetadata = includeReq.execute().getBody();
 
       // edmx:Include


Mime
View raw message