Bug 123499, enable arbitrary HTTP commands via XMLHttpRequest. Patch from matthew@mjwilson.demon.co.uk, r=heikki, sr=darin.

This commit is contained in:
heikki%netscape.com 2006-04-20 03:37:49 +00:00
parent 73d029f652
commit 250cbe186e
2 changed files with 6 additions and 2 deletions

View File

@ -149,8 +149,8 @@ interface nsIXMLHttpRequest : nsISupports {
* the request is not sent until the <code>send</code> method
* is invoked.
*
* @param method The HTTP method - either "POST" or "GET". Ignored
* if the URL is not a HTTP URL.
* @param method The HTTP method, for example "POST" or "GET". Ignored
* if the URL is not a HTTP(S) URL.
* @param url The URL to which to send the request.
* @param async Whether the request is synchronous or asynchronous
* i.e. whether send returns only after the response

View File

@ -1041,6 +1041,10 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel");
rv = uploadChannel->SetUploadStream(postDataStream, nsnull, -1);
// Reset the method to its original value
if (httpChannel) {
httpChannel->SetRequestMethod(method);
}
}
}