Opened 11 years ago
Closed 11 years ago
#10346 closed defect (invalid)
JsonRestStore problem with HtmlUnit resynchronize and PUTs
Reported by: | ashleymoran | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | DojoX Data | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
This was found with Celerity 0.7.5 (which uses a recent HtmlUnit? 2.7 snapshot). I'm not sure if this is a HtmlUnit? bug or a Dojo bug.
Using a Dojo 1.3.2 Grid,
:resynchronize => true
causes the an 'edit complete' event to fire and
attempts to send a PUT request with an empty body, but an exception is thrown before it leaves Celerity
:resynchronize => false
apparently prevents the PUT from ever being
attempted
It seems like browser resynchronising is affecting the way JsonRestStore? gets run.
My client on this project found a fix:
_overriddenXhr = dojo.xhr; dojo.xhr = function(method,args,hasBody){ if (method === "PUT"){ method = "POST"; args.headers['X-HTTP-Method-Override'] = 'PUT'; } return _overriddenXhr.apply(dojo, arguments); }
this changes the PUT to a POST and adds a suitable header such that Merb routes it all appropriately.
(To run the merb app, you need to do merb -I json_server.rb
)
Attachments (2)
Change History (6)
Changed 11 years ago by
Attachment: | json_server.rb added |
---|
Changed 11 years ago by
Attachment: | put_test.rb added |
---|
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | General → DojoX Data |
---|---|
Owner: | changed from anonymous to Kris Zyp |
comment:3 Changed 11 years ago by
If the problem is that Celerity is unable to send PUT requests, that would be an issue with Celerity.
comment:4 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
I've submitted this to the HtmlUnit? tracker as ticket 2898512, as I don't know whether it's a Dojo or HtmlUnit? issue. Sorry for the cross-posting.