| Summary: | Wrong content type header provided on diff saves | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Mark Macdonald <mamacdon> | ||||
| Component: | Client | Assignee: | Eric Moffatt <emoffatt> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | Silenio_Quarti | ||||
| Version: | 3.0 | Keywords: | triaged | ||||
| Target Milestone: | 9.0 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Passing on to the server component on advice from Mark M. Created attachment 253338 [details]
UNTESTED FIX
I misunderstood the description. Sending back to client.
BTW this should be a trivial change: attaching a (untested) patch.
kk, I'll take the easy one :) I've committed Mark's patch, testing that the code is actually used on saves... This changes causes encoding problems when the patch has non-ASCII characters. The change should include the charset as follow: "application/json;charset=UTF-8" That is a good workaround, but IMO the fact that the server decodes "Content-Type: application/json" in a platform-dependent default character set is a bug. JSON specifies UTF-8 as the default encoding, so that's what should get used. I opened bug 470615 for this. |
The Orion client sends diff saves as a JSON object > { > diff: [{ > start: 0, end: 1, text: "a" > }] > } However it does not set a Content Type header. This causes the browser to provide 'text/plain' by default (at least in Chrome). The client should send 'application/json-patch' or 'application/json'.