mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-21 20:03:08 +09:00
Issue #2402 - Persist response headers for offlined service worker scripts. https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
This commit is contained in:
parent
14f0bc5e7c
commit
b723bb60ad
2 changed files with 19 additions and 4 deletions
|
|
@ -239,6 +239,7 @@ public:
|
|||
CompareCallback* aCallback)
|
||||
: mRegistration(aRegistration)
|
||||
, mCallback(aCallback)
|
||||
, mInternalHeaders(new InternalHeaders())
|
||||
, mState(WaitingForOpen)
|
||||
, mNetworkFinished(false)
|
||||
, mCacheFinished(false)
|
||||
|
|
@ -425,11 +426,21 @@ public:
|
|||
return mCacheStorage;
|
||||
}
|
||||
|
||||
void
|
||||
InitChannelInfo(nsIChannel* aChannel)
|
||||
nsresult
|
||||
OnStartRequest(nsIChannel* aChannel)
|
||||
{
|
||||
nsresult rv = SetPrincipalInfo(aChannel);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
mChannelInfo.InitFromChannel(aChannel);
|
||||
|
||||
mInternalHeaders->FillResponseHeaders(aChannel);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
SetPrincipalInfo(nsIChannel* aChannel)
|
||||
|
|
@ -553,6 +564,9 @@ private:
|
|||
ir->SetPrincipalInfo(Move(mPrincipalInfo));
|
||||
}
|
||||
|
||||
IgnoredErrorResult ignored;
|
||||
ir->Headers()->Fill(*mInternalHeaders, ignored);
|
||||
|
||||
RefPtr<Response> response = new Response(aCache->GetGlobalObject(), ir, nullptr);
|
||||
|
||||
RequestOrUSVString request;
|
||||
|
|
@ -587,6 +601,7 @@ private:
|
|||
nsString mNewCacheName;
|
||||
|
||||
ChannelInfo mChannelInfo;
|
||||
RefPtr<InternalHeaders> mInternalHeaders;
|
||||
|
||||
UniquePtr<mozilla::ipc::PrincipalInfo> mPrincipalInfo;
|
||||
|
||||
|
|
@ -682,8 +697,7 @@ CompareNetwork::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
|||
MOZ_ASSERT(channel == mChannel);
|
||||
#endif
|
||||
|
||||
mManager->InitChannelInfo(mChannel);
|
||||
nsresult rv = mManager->SetPrincipalInfo(mChannel);
|
||||
nsresult rv = mManager->OnStartRequest(mChannel);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue