Bug 1087633, Filter out XPConnect wrapped input streams, r=bz

--HG--
extra : rebase_source : a33654c249bc60464fe3c1a372dee0f58ee465c7
This commit is contained in:
Olli Pettay 2014-10-31 19:11:08 +02:00
parent 38a8007713
commit f645ceca72

View File

@ -27,6 +27,7 @@
#include "nsIPrincipal.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsISizeOfEventTarget.h"
#include "nsIXPConnect.h"
#include "mozilla/Assertions.h"
#include "mozilla/DOMEventTargetHelper.h"
@ -463,6 +464,11 @@ public:
void Send(nsIInputStream* aStream, ErrorResult& aRv)
{
NS_ASSERTION(aStream, "Null should go to string version");
nsCOMPtr<nsIXPConnectWrappedJS> wjs = do_QueryInterface(aStream);
if (wjs) {
aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
return;
}
aRv = Send(RequestBody(aStream));
}
void SendAsBinary(const nsAString& aBody, ErrorResult& aRv);