Bug 1648523 [wpt PR 24343] - [html] Omit empty COOP/COEP reporting HTTP headers, a=testonly
authorjugglinmike <mike@mikepennisi.com>
Wed, 26 Aug 2020 08:51:22 +0000
changeset 546473 04763d56500e9cb01d25e9500b10ac585a72d611
parent 546472 b1f6fa9114e594aa6dd07e5e9cd59808ef2d9481
child 546474 82662893c0b21f04201cd7b3b7df6a65a14bcb42
push id125110
push userwptsync@mozilla.com
push dateThu, 27 Aug 2020 08:51:30 +0000
treeherderautoland@e3f460a309d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1648523, 24343
milestone82.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1648523 [wpt PR 24343] - [html] Omit empty COOP/COEP reporting HTTP headers, a=testonly Automatic update from web-platform-tests [html] Omit empty COOP/COEP reporting HTTP headers (#24343) Prior to this patch, when a test made a request to the `coop-coep.py` and did not specify a desired value for the "report only" headers, the response would include the headers without values. Only include "report only" headers when they have been explicitly specified. Should tests require empty values for these headers (as in the original behavior), they may specify query string parameters without values, e.g. coop-coep.py?coop-report-only= -- wpt-commits: 2520b441890b9a2156e16732f97fbf7867fcbd68 wpt-pr: 24343
testing/web-platform/tests/html/cross-origin-opener-policy/resources/coop-coep.py
--- a/testing/web-platform/tests/html/cross-origin-opener-policy/resources/coop-coep.py
+++ b/testing/web-platform/tests/html/cross-origin-opener-policy/resources/coop-coep.py
@@ -1,21 +1,21 @@
 def main(request, response):
     coop = request.GET.first(b"coop")
-    coopReportOnly = request.GET.first(b"coop-report-only") if b"coop-report-only" in request.GET else b""
+    coopReportOnly = request.GET.first(b"coop-report-only", None)
     coep = request.GET.first(b"coep")
-    coepReportOnly = request.GET.first(b"coep-report-only") if b"coep-report-only" in request.GET else b""
+    coepReportOnly = request.GET.first(b"coep-report-only", None)
     redirect = request.GET.first(b"redirect", None)
     if coop != b"":
         response.headers.set(b"Cross-Origin-Opener-Policy", coop)
-    if coop != b"":
+    if coopReportOnly is not None:
         response.headers.set(b"Cross-Origin-Opener-Policy-Report-Only", coopReportOnly)
     if coep != b"":
         response.headers.set(b"Cross-Origin-Embedder-Policy", coep)
-    if coep != b"":
+    if coepReportOnly is not None:
         response.headers.set(b"Cross-Origin-Embedder-Policy-Report-Only", coepReportOnly)
     if b'cache' in request.GET:
         response.headers.set(b'Cache-Control', b'max-age=3600')
     host = request.url_parts[1]
 
     if redirect != None:
         response.status = 302
         response.headers.set(b"Location", redirect)