microsoft / fhir-server

A service that implements the FHIR standard
MIT License
1.18k stars 507 forks source link

$export fails on Accept header from HttpClient #3876

Open LodewijkSioen opened 4 months ago

LodewijkSioen commented 4 months ago

Describe the bug The dotnet (8) HttpClient insists on adding ; charset=utf-8 to the Accept-header of a request. This causes an error in the $export operation because this line of code checks if the accept header is exactly the same as application/fhir+json. I think this line should be changed to StartsWith.

FHIR Version? R4

Data provider? SQL Server

To Reproduce Steps to reproduce the behavior:

  1. Call the $export endpoint with a dotnet HttpClient
  2. Watch it burn

Expected behavior It should work

Actual behavior

Operation was unsuccessful because of a client error (BadRequest). OperationOutcome: Overall result: FAILURE (1 errors and 0 warnings)\r\n[ERROR] (no details)(further diagnostics: Value supplied for the \"Accept\" header is not supported.)\r\n.
LodewijkSioen commented 4 months ago

Sorry, the issue is with the Firely FhirClient, not the dotnet fhirclient. Still, I think the issue is valid.