Strip out Referer header when requesting subresources or following links for document...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Dec 2015 02:26:45 +0000 (02:26 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Dec 2015 02:26:45 +0000 (02:26 +0000)
commit083240aa54b048bdc6aa13c5a5f1952a0a9960f7
tree82ed04b5019cfc06e6fadc542b483764b7dec79e
parent5a272ebe5a0dae892f3dd242a143dd28709d53e2
Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"
https://bugs.webkit.org/show_bug.cgi?id=152102
<rdar://problem/22124230>

Reviewed by Andy Estes.

Source/WebCore:

Keep the ReferrerPolicy for a document as ReferrerPolicyNever if the document is loaded with
"Content-Disposition: attachment".

Test: http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html

* dom/Document.cpp:
(WebCore::Document::processReferrerPolicy):
(WebCore::Document::applyContentDispositionAttachmentSandbox):

LayoutTests:

* http/tests/contentdispositionattachmentsandbox/resources/echo-http-referer.php: Added.
* http/tests/contentdispositionattachmentsandbox/resources/subresource-request-not-include-referer-header-frame.php: Added.
* http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header-expected.txt: Added.
* http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/contentdispositionattachmentsandbox/resources/echo-http-referer.php [new file with mode: 0644]
LayoutTests/http/tests/contentdispositionattachmentsandbox/resources/subresource-request-not-include-referer-header-frame.php [new file with mode: 0644]
LayoutTests/http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp