ericabouaf / wireit

A javascript wiring library to create web wirable interfaces for dataflow applications, visual programming languages or graphical modeling.
http://neyric.github.io/wireit/docs/
Other
520 stars 90 forks source link

Ajax adapter PUT content-type is browser specific; should be application/x-www-form-urlencoded #23

Closed dlitz closed 12 years ago

dlitz commented 14 years ago

When the Ajax adapter does a PUT to save the diagram, the content-type seems to be whatever the browser defaults to. Safari uses "application/xml" and Firefox uses "text/plain".

The setDefaultPostHeader('application/json') seems to be ignored, probably because we're doing a PUT and not a POST. In any case, application/json is wrong, since the data being PUT is clearly URL-encoded.

I have a patch against master, which I've tested: http://github.com/dlitz/wireit/commit/63f494d776b5feb0c931e6add0dbdcc43e6db0f6

The Ajax adapter in edge doesn't seem to work, but here's a patch that sets the content-type anyway: http://github.com/dlitz/wireit/commit/0df089f09a684e0832be5b9d23e41b05b634aed5