Skip to content

Commit

Permalink
fix: not convert to XML when request accept is XML
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Oct 8, 2023
1 parent 23c8de3 commit 85501a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/FHIRApiService/services/base.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ class BaseFhirApiService {
item = handleError.processing(item);
}

if (this.response.getHeader("content-type").includes("xml")) {
if (this.response.getHeader("content-type").includes("xml") ||
this.request.get("accept").includes("xml")
) {
let fhir = new FHIR();
let xmlItem = fhir.objToXml(item);
if (this._pretty) xmlItem = xmlFormatter(xmlItem);
Expand Down

0 comments on commit 85501a5

Please sign in to comment.