Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Content-Type header is case sensitive in parseItem middleware #368
I'm trying out the Azure Mobile App API and getting an error on making Patch calls.
GET and POST and DELETE works fine.
Here is what my url looks like:
I have these as headers too (as I said other http verbs work.)
And I get 500 error back with this in the body:
The same id works when I do a GET using that id...
And when I make the same call using same body with PUT i get a 404 Not found without any content in the response body.
It turns out our implementation requires the content-type header value to be lower case, i.e. application/json works, whereas Application/Json doesn't. I've updated this issue to be the placeholder for the fix. As a workaround in the meantime, make the value for the content-type header lower case.
https://github.com/Azure/azure-mobile-apps-node/blob/master/src/express/middleware/parseItem.js#L27 should use req.get instead of req.headers. Keep in mind that values can also include encoding, e.g. application/json; charset=utf-8