google / fhir-gateway

A generic proxy server for applying access-control policies for a FHIR-store.
https://google.github.io/fhir-gateway/
Other
75 stars 29 forks source link

Support client supplied Accept header in API requests #60

Open vivekmittal07 opened 1 year ago

vivekmittal07 commented 1 year ago

Proxy is always setting the response content type to a default header - proxyResponse.getResponseWriter We are ignoring the Accept header sent by the client.

We expect the FHIR response to be in JSON. If we send application/xml then this will break the code. fhir-access-proxy/plugins/src/main/java/com/google/fhir/proxy/plugin/AccessGrantedAndUpdateList.java

I tried the create Patient API with "Accept: application/fhir+xml" and I get this error in AccessGrantedAndUpdateList "Content does not appear to be FHIR JSON, first non-whitespace character was: "

We need to add support for client specified Accept header and return the corresponding Content-type

bashir2 commented 1 year ago

We should at least document the expectation on content-type/charset until we properly fix this issue.