mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1363311 - Honor Set-Cookie headers in multipart/mixed response boundary headers in e10s mode; r=jdm
This commit is contained in:
parent
c200b63e89
commit
87f01dcea3
@ -144,7 +144,8 @@ nsresult
|
||||
CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
|
||||
nsIChannel *aChannel,
|
||||
const char *aCookieString,
|
||||
const char *aServerTime)
|
||||
const char *aServerTime,
|
||||
bool aFromHttp)
|
||||
{
|
||||
NS_ENSURE_ARG(aHostURI);
|
||||
NS_ENSURE_ARG_POINTER(aCookieString);
|
||||
@ -179,7 +180,7 @@ CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
|
||||
|
||||
// Synchronously call the parent.
|
||||
SendSetCookieString(uriParams, !!isForeign, cookieString, serverTime,
|
||||
attrs);
|
||||
attrs, aFromHttp);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -220,7 +221,8 @@ CookieServiceChild::SetCookieString(nsIURI *aHostURI,
|
||||
const char *aCookieString,
|
||||
nsIChannel *aChannel)
|
||||
{
|
||||
return SetCookieStringInternal(aHostURI, aChannel, aCookieString, nullptr);
|
||||
return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
|
||||
nullptr, false);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -231,7 +233,8 @@ CookieServiceChild::SetCookieStringFromHttp(nsIURI *aHostURI,
|
||||
const char *aServerTime,
|
||||
nsIChannel *aChannel)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
|
||||
aServerTime, true);
|
||||
}
|
||||
|
||||
} // namespace net
|
||||
|
@ -47,7 +47,8 @@ protected:
|
||||
nsresult SetCookieStringInternal(nsIURI *aHostURI,
|
||||
nsIChannel *aChannel,
|
||||
const char *aCookieString,
|
||||
const char *aServerTime);
|
||||
const char *aServerTime,
|
||||
bool aFromHttp);
|
||||
|
||||
void PrefChanged(nsIPrefBranch *aPrefBranch);
|
||||
|
||||
|
@ -109,7 +109,8 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost,
|
||||
const bool& aIsForeign,
|
||||
const nsCString& aCookieString,
|
||||
const nsCString& aServerTime,
|
||||
const OriginAttributes& aAttrs)
|
||||
const OriginAttributes& aAttrs,
|
||||
const bool& aFromHttp)
|
||||
{
|
||||
if (!mCookieService)
|
||||
return IPC_OK();
|
||||
@ -134,7 +135,7 @@ CookieServiceParent::RecvSetCookieString(const URIParams& aHost,
|
||||
// NB: dummyChannel could be null if something failed in CreateDummyChannel.
|
||||
nsDependentCString cookieString(aCookieString, 0);
|
||||
mCookieService->SetCookieStringInternal(hostURI, aIsForeign, cookieString,
|
||||
aServerTime, false, aAttrs,
|
||||
aServerTime, aFromHttp, aAttrs,
|
||||
dummyChannel);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
@ -32,7 +32,8 @@ protected:
|
||||
const bool& aIsForeign,
|
||||
const nsCString& aCookieString,
|
||||
const nsCString& aServerTime,
|
||||
const OriginAttributes& aAttrs) override;
|
||||
const OriginAttributes& aAttrs,
|
||||
const bool& aFromHttp) override;
|
||||
|
||||
RefPtr<nsCookieService> mCookieService;
|
||||
};
|
||||
|
@ -97,7 +97,8 @@ parent:
|
||||
bool isForeign,
|
||||
nsCString cookieString,
|
||||
nsCString serverTime,
|
||||
OriginAttributes attrs);
|
||||
OriginAttributes attrs,
|
||||
bool aFromHttp);
|
||||
|
||||
async __delete__();
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ function make_channel(url) {
|
||||
return NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
|
||||
}
|
||||
|
||||
var multipartBody = "--boundary\r\n\r\nSome text\r\n--boundary\r\nContent-Type: text/x-test\r\n\r\n<?xml version='1.1'?>\r\n<root/>\r\n--boundary\r\n\r\n<?xml version='1.0'?><root/>\r\n--boundary--";
|
||||
var multipartBody = "--boundary\r\nSet-Cookie: foo=bar\r\n\r\nSome text\r\n--boundary\r\nContent-Type: text/x-test\r\n\r\n<?xml version='1.1'?>\r\n<root/>\r\n--boundary\r\n\r\n<?xml version='1.0'?><root/>\r\n--boundary--";
|
||||
|
||||
function contentHandler(metadata, response)
|
||||
{
|
||||
|
3
netwerk/test/unit_ipc/test_multipart_streamconv_wrap.js
Normal file
3
netwerk/test/unit_ipc/test_multipart_streamconv_wrap.js
Normal file
@ -0,0 +1,3 @@
|
||||
function run_test() {
|
||||
run_test_in_child("../unit/test_multipart_streamconv.js");
|
||||
}
|
@ -56,6 +56,7 @@ support-files =
|
||||
!/netwerk/test/unit/test_alt-data_simple.js
|
||||
!/netwerk/test/unit/test_alt-data_stream.js
|
||||
!/netwerk/test/unit/test_channel_priority.js
|
||||
!/netwerk/test/unit/test_multipart_streamconv.js
|
||||
|
||||
[test_bug528292_wrap.js]
|
||||
[test_bug248970_cookie_wrap.js]
|
||||
@ -101,3 +102,4 @@ skip-if = true
|
||||
[test_trackingProtection_annotateChannels_wrap1.js]
|
||||
[test_trackingProtection_annotateChannels_wrap2.js]
|
||||
[test_channel_priority_wrap.js]
|
||||
[test_multipart_streamconv_wrap.js]
|
||||
|
Loading…
Reference in New Issue
Block a user