Bug 1698767 - Use ExtContentPolicyType instead of InternalContentPolicyType in SecFetch::IsUserTriggeredForSecFetchSite r=ckerschb

The internal content policy type of `TYPE_INTERNAL_IFRAME` gets mapped to `ExtContentPolicy::TYPE_SUBDOCUMENT`, so there is no need to use the internal type.

Differential Revision: https://phabricator.services.mozilla.com/D108640
This commit is contained in:
Niklas Goegge 2021-03-17 11:43:34 +00:00
Родитель ed5eaf624b
Коммит abde84c961
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -202,13 +202,12 @@ bool IsUserTriggeredForSecFetchSite(nsIHttpChannel* aHTTPChannel) {
* user agents address bar, bookmarks, etc).
*/
nsCOMPtr<nsILoadInfo> loadInfo = aHTTPChannel->LoadInfo();
nsContentPolicyType contentType = loadInfo->InternalContentPolicyType();
ExtContentPolicyType contentType = loadInfo->GetExternalContentPolicyType();
// only requests wich result in type "document" are subject to
// user initiated actions in the context of SecFetch.
if (contentType != nsIContentPolicy::TYPE_DOCUMENT &&
contentType != nsIContentPolicy::TYPE_SUBDOCUMENT &&
contentType != nsIContentPolicy::TYPE_INTERNAL_IFRAME) {
if (contentType != ExtContentPolicy::TYPE_DOCUMENT &&
contentType != ExtContentPolicy::TYPE_SUBDOCUMENT) {
return false;
}