Summary: | XMLHttpRequest: PUT, DELETE, HEAD and all other methods but POST actually do a GET | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Henri Sivonen <hsivonen> | ||||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Major | CC: | adam, adam, ap, bugs-webkit, cdumez, gabor.farkas, imarkroger, jacmesj, jeff, michaelhill789, pswag994, raokrishnavasudeva, rsneha027, sen, stuartmorgan, svillar, yagmurcanayakin | ||||||
Priority: | P2 | ||||||||
Version: | 312.x | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.3 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 7390 | ||||||||
Attachments: |
|
Description
Henri Sivonen
2005-07-02 05:15:32 PDT
This also applies to other verbs not explicitly defined in the HTTP spec, such as SEARCH used in HTTP-DAV. In my case, this prevents me from writing a client to access Microsoft Exchange servers. Comfirmed in ToT by source inspection; anything unknown is treated as a GET. Would be nice to have a test case. Although w/o server side support, that might be hard. Writing a synthetic test shouldn't be too hard (one could take one from bug 3810 as a model), but it would be very helpful to have an example of a "real life" application that uses this. *** Bug 7390 has been marked as a duplicate of this bug. *** Created attachment 6776 [details] proposed patch There are some differences between this implementaion and Firefox: 1) For null data, "Content-Length: 0" header is sent (isn't sent in Firefox). Looks like better behavior to me; besides, I don't think we have a choice, because this header is added by NSURLConnection. 2) HEAD is not implemented - there seems to be a crashing bug in NSURLConnection, <rdar://4460899>. 3) After #2 is fixed, we won't be sending a body in HEAD requests, just like we don't send it in GET ones. Firefox ignores the body in GET requests, but sends it in HEAD ones, which looks like a bug to me. Also fixed a bug: send(null) was actually sending characters "null" instead of an empty body. Comment on attachment 6776 [details]
proposed patch
Should use String instead of QString in new code, like the new parameter to TransferJob. String converts itself into NSString without even calling getNSString().
Created attachment 6786 [details]
proposed patch
Addressed the comments.
Comment on attachment 6786 [details]
proposed patch
Change looks fine as is, but I have three comments:
1) Is there a test for the change in JSXMLHttpRequest.cpp? That change looks fine, but I'd like to see a test that was broken before and fixed now.
2) Since method is now a String you can use equalIgnoringCase rather than calling lower when comparing the method with head.
3) I would like the client pointer to be the first parameter to TransferJob and the method the second parameter, because the client pointer sort of a "back pointer to the claler" while the rest of the parameters are the specification of what the job is to do.
The most important of these three is (1), but I think none are a big enough deal to prevent landing the patch. I'll say r=me.
(In reply to comment #9) 1) Yes, the tests call send(null) for all methods, and there were a lot of failures before I fixed this. 2) Actually, method in XMLHTTPRequest class is still a QString, I haven't changed it. 3) Done. Committed r78043: <http://trac.webkit.org/changeset/78043> (In reply to comment #11) > Committed r78043: <http://trac.webkit.org/changeset/78043> Sorry for the noise. I just mentioned this bug in a ChangeLog, it seems that webkit-patch was too smart this time. This still remains fixed :) Mass moving XML DOM bugs to the "DOM" Component. |