Title: [261485] trunk/Source/WebCore
- Revision
- 261485
- Author
- [email protected]
- Date
- 2020-05-11 11:59:22 -0700 (Mon, 11 May 2020)
Log Message
Fix assertion after r261414
https://bugs.webkit.org/show_bug.cgi?id=211731
This fixes a debug assertion that fired 100% of the time when running the test introduced in r261414
I also respond to Darin's and Youenn's post-commit feedback.
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::generateReferrerHeader):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setHTTPReferrer):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (261484 => 261485)
--- trunk/Source/WebCore/ChangeLog 2020-05-11 18:43:15 UTC (rev 261484)
+++ trunk/Source/WebCore/ChangeLog 2020-05-11 18:59:22 UTC (rev 261485)
@@ -1,3 +1,16 @@
+2020-05-11 Alex Christensen <[email protected]>
+
+ Fix assertion after r261414
+ https://bugs.webkit.org/show_bug.cgi?id=211731
+
+ This fixes a debug assertion that fired 100% of the time when running the test introduced in r261414
+ I also respond to Darin's and Youenn's post-commit feedback.
+
+ * page/SecurityPolicy.cpp:
+ (WebCore::SecurityPolicy::generateReferrerHeader):
+ * platform/network/ResourceRequestBase.cpp:
+ (WebCore::ResourceRequestBase::setHTTPReferrer):
+
2020-05-11 Andres Gonzalez <[email protected]>
Check the validity of the underlying Document before updating the isolated tree.
Modified: trunk/Source/WebCore/page/SecurityPolicy.cpp (261484 => 261485)
--- trunk/Source/WebCore/page/SecurityPolicy.cpp 2020-05-11 18:43:15 UTC (rev 261484)
+++ trunk/Source/WebCore/page/SecurityPolicy.cpp 2020-05-11 18:59:22 UTC (rev 261485)
@@ -90,7 +90,8 @@
String SecurityPolicy::generateReferrerHeader(ReferrerPolicy referrerPolicy, const URL& url, const String& referrer)
{
- ASSERT(referrer == URL(URL(), referrer).strippedForUseAsReferrer());
+ ASSERT(referrer == URL(URL(), referrer).strippedForUseAsReferrer()
+ || referrer == SecurityOrigin::create(URL(URL(), referrer))->toString());
if (referrer.isEmpty())
return String();
Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp (261484 => 261485)
--- trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp 2020-05-11 18:43:15 UTC (rev 261484)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp 2020-05-11 18:59:22 UTC (rev 261485)
@@ -378,7 +378,8 @@
void ResourceRequestBase::setHTTPReferrer(const String& httpReferrer)
{
- const size_t maxLength = 4096;
+ // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
+ constexpr size_t maxLength = 4096;
if (httpReferrer.length() > maxLength) {
RELEASE_LOG(Loading, "Truncating HTTP referer");
String origin = SecurityOrigin::create(URL(URL(), httpReferrer))->toString();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes