AmpersandJS / ampersand-sync

Provides sync behavior for updating data from ampersand models and collections to the server.
http://ampersandjs.com
MIT License
20 stars 28 forks source link

Peculiar behaviour with header override #69

Closed dhritzkiv closed 9 years ago

dhritzkiv commented 9 years ago

With the latest ampersand-sync, overriding request headers can result in incorrectly concatenated header lines.

Here's a gist showing that passing in {"Content-Type": "application/json}" as a headers option results in the outgoing request header value of application/json, application/json. The gist makes the same request with ampersand-sync (broken here), as well as xhr (fine here), which might suggest the problem lies in ampersand-sync

Tested with both Chrome and Safari using POST requests.

naugtur commented 9 years ago

That's an issue with case sensitivity in xhr. This PR fixes it as a side effect: https://github.com/Raynos/xhr/pull/90

I'll release it and bump version in sync

dhritzkiv commented 9 years ago

Sounds good

dhritzkiv commented 9 years ago

Is an npm version bump coming soon? ☺️

naugtur commented 9 years ago

It's out as of now.