Hi all,
I’m trying to set some custom content type headers on some JsonRoutes, like so:
JsonRoutes.setResponseHeaders({
"Content-Type": "application/fhir+json"
});
I’ve also tried setting in the route itself:
JsonRoutes.add("post", "/fhir/Patient", function (req, res, next) {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Content-Type", "application/fhir+json");
// etc etc etc
});
But everything arrives to Postman with a content-type of application/json
. Any thoughts on what might be going on? Or how to fix this?
@sashko ?
sashko
January 7, 2017, 12:44am
2
Hmmmm… would you accept a pull request so we can set custom header types? Or maybe just setHeader() after writeJsonToBody()?
1 Like
sashko
January 7, 2017, 12:47am
4
Yeah I think we should just change the order of the calls! So you can override that header if you want to. Please send a PR and I’ll try to publish before dinner!
1 Like
Perfect! Just submitted it. If you want it submitted to another branch, just let me know.
sashko
January 7, 2017, 12:53am
6
Great, going to take a look now.
any update on this? I’m trying to override content-type but is not working