awslabs / fhir-works-on-aws-routing

The routing implementation of the FHIR Works on AWS framework. Finding the correct component to handle the HTTP FHIR request
Apache License 2.0
31 stars 26 forks source link

change content-type to accept header #167

Closed liquid36 closed 2 years ago

liquid36 commented 2 years ago

Hi! I think that is better to check for de Accept header rather than the ContentType header. Accept header is about what the client expect.

https://github.com/awslabs/fhir-works-on-aws-routing/blob/cb044c37620248a0bd5f261761dd9dc09dbfa426/src/router/middlewares/setContentType.ts#L16

Particulary, i'm going throw ONC Certification, and the $export test expect to have an application/json response, not a application/fhir+josn response.

What do you think?

Bingjiling commented 2 years ago

Hi @liquid36,

Thanks for spotting the issue! I've checked the FHIR spec and you're right about this one. As this is a one-line change, do you want to take the opportunity and create a PR for it?

Thanks, Yanyu

liquid36 commented 2 years ago

Yes, no problem.

168