File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -914,7 +914,22 @@ mozilla::ipc::IPCResult HttpChannelParent::RecvRedirect2Verify(
914
914
nsCOMPtr<nsIApplicationCacheChannel> appCacheChannel =
915
915
do_QueryInterface (newHttpChannel);
916
916
if (appCacheChannel) {
917
- appCacheChannel->SetChooseApplicationCache (aChooseAppcache);
917
+ bool setChooseAppCache = false ;
918
+ if (aChooseAppcache) {
919
+ nsCOMPtr<nsIURI> uri;
920
+ // Using GetURI because this is what DoAsyncOpen uses.
921
+ newHttpChannel->GetURI (getter_AddRefs (uri));
922
+
923
+ OriginAttributes attrs;
924
+ NS_GetOriginAttributes (newHttpChannel, attrs);
925
+
926
+ nsCOMPtr<nsIPrincipal> principal =
927
+ BasePrincipal::CreateContentPrincipal (uri, attrs);
928
+
929
+ setChooseAppCache = NS_ShouldCheckAppCache(principal);
930
+ }
931
+
932
+ appCacheChannel->SetChooseApplicationCache (setChooseAppCache);
918
933
}
919
934
920
935
nsCOMPtr<nsILoadInfo> newLoadInfo = newHttpChannel->LoadInfo ();
You can’t perform that action at this time.
0 commit comments