diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 2e6b2ec52b1..e3225a7d88b 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -88,6 +88,7 @@ #include "nsWhitespaceTokenizer.h" #include "nsIMultiPartChannel.h" #include "nsIScriptObjectPrincipal.h" +#include "nsIStorageStream.h" #define LOAD_STR "load" #define ERROR_STR "error" @@ -2134,10 +2135,12 @@ nsXMLHttpRequest::Send(nsIVariant *aBody) // Serialize to a stream so that the encoding used will // match the document's. - nsCOMPtr input; + nsCOMPtr storStream; + rv = NS_NewStorageStream(4096, PR_UINT32_MAX, getter_AddRefs(storStream)); + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr output; - rv = NS_NewPipe(getter_AddRefs(input), getter_AddRefs(output), - 0, PR_UINT32_MAX); + rv = storStream->GetOutputStream(0, getter_AddRefs(output)); NS_ENSURE_SUCCESS(rv, rv); // Empty string for encoding means to use document's current @@ -2146,7 +2149,8 @@ nsXMLHttpRequest::Send(nsIVariant *aBody) NS_ENSURE_SUCCESS(rv, rv); output->Close(); - postDataStream = input; + rv = storStream->NewInputStream(0, getter_AddRefs(postDataStream)); + NS_ENSURE_SUCCESS(rv, rv); } else { // nsISupportsString? nsCOMPtr wstr(do_QueryInterface(supports)); diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index 64587f7a85f..7350d7bb086 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -181,6 +181,7 @@ _TEST_FILES = test_bug5141.html \ test_bug419527.xhtml \ test_bug420609.xhtml \ test_bug420700.html \ + test_bug422537.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/base/test/test_bug422537.html b/content/base/test/test_bug422537.html new file mode 100644 index 00000000000..3867cb78087 --- /dev/null +++ b/content/base/test/test_bug422537.html @@ -0,0 +1,55 @@ + + + + + Test for bug 422537 + + + + + + +Mozilla Bug 422537 +

+ +
+
+
+ + + +