[
https://issues.apache.org/jira/browse/OLINGO-598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14375638#comment-14375638
]
Michael Bolz commented on OLINGO-598:
-------------------------------------
Hi [~marcveser],
The request headers are not passed to the {{Processor}} methods.
Only {{custom query options}} are passed.
To get the headers of the {{HTTP request}} you can access the via the
{{ODataContext}} which is available in the {{ODataServiceFactory}} as parameter
in {{createService(...)}} method.
For the *JPA extension* you can take a look into the {{ODataJPAServiceFactory}}
and/or in the according reference scenario implementation
{{JPAReferenceServiceFactory}} and the {{initializeODataJPAContext()}} method.
Within this method you could use something like
{{getODataJPAContext().getODataContext().getRequestHeaders()}} to get access to
the {{HTTP request headers}}.
Hope this answers your question and if this is the case it would be nice if you
could close this issue ;o)
Best regards,
Michael
> Custom http request headers are lost
> ------------------------------------
>
> Key: OLINGO-598
> URL: https://issues.apache.org/jira/browse/OLINGO-598
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa
> Affects Versions: V2 2.0.3
> Reporter: Marc Veser
> Assignee: Michael Bolz
> Priority: Critical
>
> Hi,
> I'm sending a GET request (read entity) with manually added custom request
> headers ("Release = true"). These headers are not passed as import parameters
> in ODataJPAProcessor.readEntity(). The "standard" headers such as "Accept"
> are there.
> The request I'm sending is more or less the following:
> Request URL:https://host/serviceName/EntitySet('EntityKey')
> Request Method:GET
> Connection: keep-alive
> MaxDataServiceVersion: 2.0
> Accept-Language: en
> User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36
> (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36
> Accept: application/json
> DataServiceVersion: 2.0
> Release: true
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)