Bug 1339153 - Part 1: Correctly emulate missing headers in nsViewSourceChannel::GetResponseHeader, r=bz

MozReview-Commit-ID: 34bCA7wKkmh
This commit is contained in:
Michael Layzell 2017-02-13 13:57:39 -05:00
Родитель 570037515c
Коммит a71fd85f7d
1 изменённых файлов: 5 добавлений и 1 удалений

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

@ -907,7 +907,11 @@ nsViewSourceChannel::GetResponseHeader(const nsACString & aHeader,
nsCaseInsensitiveCStringComparator()) &&
!aHeader.Equals(NS_LITERAL_CSTRING("X-Frame-Options"),
nsCaseInsensitiveCStringComparator())) {
return NS_OK;
// We simulate the NS_ERROR_NOT_AVAILABLE error which is produced by
// GetResponseHeader via nsHttpHeaderArray::GetHeader when the entry is
// not present, such that it appears as though no headers except for the
// whitelisted ones were set on this channel.
return NS_ERROR_NOT_AVAILABLE;
}
return mHttpChannel->GetResponseHeader(aHeader, aValue);