Bug 122069 - XMLHttpRequest Object Should Allow DELETE, HEAD, TRACE, PUT, OPTIONS Methods
Summary: XMLHttpRequest Object Should Allow DELETE, HEAD, TRACE, PUT, OPTIONS Methods
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-15 23:03 UTC by Troy Melhase
Modified: 2010-11-12 04:31 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Melhase 2006-02-15 23:03:28 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Per the source at:

http://websvn.kde.org/trunk/KDE/kdelibs/khtml/ecma/xmlhttprequest.cpp

and the commit messages at:

http://lists.kde.org/?l=kde-commits&w=2&r=1&s

The XMLHttpRequest object does not allow all HTTP methods.  The module defines 
BANNED_HTTP_HEADERS, which includes several perfectly valid HTTP methods such as DELETE, HEAD, TRACE, OPTIONS, and PUT.

Not having this feature in KHTML limits its ability to use REST-ful resources (see http://en.wikipedia.org/wiki/REST) that require such methods.

Further, HTTP servers (and caches, proxies, and the like) are meant to restrict/allow/process requests based the HTTP method, not clients.


See the HTTP RFC at http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html for a complete list of all HTTP methods.
Comment 1 John Mulligan 2008-08-28 02:34:48 UTC
I am working on a REST based script and was bitten by this. My application wants to create new resources via PUT and remove them via DELETE. 

The W3C specification [1] for XMLHttpRequest objects states that these methods are required. It looks like canSetRequestHeader still lists these as blacklisted.

I am running konqueror version 4.1.00.
For now I will test in Firefox, but I prefer to use konqueror on my own desktop.

[1] http://www.w3.org/TR/XMLHttpRequest/#dependencies



Comment 2 Roman Yepishev 2009-12-15 07:04:25 UTC
This bug breaks Ubuntu One web UI file removals completely.

The only supported methods are GET and POST and everything else is converted to GET request:

kdelibs-728671/khtml/ecma/xmlhttprequest.cpp:
void XMLHttpRequest::send(const QString& _body, int& ec)
{
   ...
   if (method == "post") {
     ...

     job = KIO::http_post( url, buf, KIO::HideProgressInfo );
     ...
   }
   else {
     job = KIO::get( url, KIO::NoReload, KIO::HideProgressInfo );
   }
   ...
}

See https://bugs.launchpad.net/khtml/+bug/493813
Comment 3 Allan Sandfeld 2010-04-16 18:54:29 UTC
Most implementations of XMLHttpRequest does support at least GET,POST,PUT and DELETE. The rest are low priority as they are not consistently implemented.
Comment 4 Maksim Orlovich 2010-11-12 04:31:27 UTC
SVN commit 1195838 by orlovich:

A couple of fixes/improvements for XHR:
- Support custom request types (#122069)
- Support the weirdo x-user-defined "encoding" which basically acts as a binary mode.

With both of these fixes, we can boot up the WebODF demo and view some of the simpler documents. Doesn't work entirely though 
(one issue is a CSSOM one, but not sure if anything else is wrong)

BUG: 122069


 M  +72 -22    xmlhttprequest.cpp  
 M  +5 -1      xmlhttprequest.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1195838