Bug 159625 - Fix exception in cors-tester.py in WPT tests r=jgraham
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 15 Nov 2019 19:44:34 +0000
changeset 502274 c1e961421fe1aea3523b6fdf4dba49126a70f6a7
parent 502273 998d992ca22bda687da401a82ddb42afc10af96a
child 502275 f7679d8469b66ed60ad902806b67ebfff4c58e5f
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs159625
milestone72.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 159625 - Fix exception in cors-tester.py in WPT tests r=jgraham cookie.value can't be accessed when cookie.first defaults to "no" which causes it to throw an exception. This change makes it so we only access cookie.value when the cookie.first actually returns a cookie. Differential Revision: https://phabricator.services.mozilla.com/D53167
testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
--- a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
@@ -26,19 +26,19 @@ def main(request, response):
         return [("Content-Type", "text/plain")], "OK"
 
     if "origin" in request.GET:
         response.headers.set('Access-Control-Allow-Origin', request.GET['origin'])
         response.headers.set('Access-Control-Allow-Credentials', 'true')
 
     cors = request.headers.get("origin", "no")
 
-    cookie = request.cookies.first(id, "no")
-
-    line = 'cors = ' + cors + ' | cookie = ' + cookie.value;
+    cookie = request.cookies.first(id, None)
+    cookie_value = cookie.value if cookie is not None else "no"
+    line = 'cors = ' + cors + ' | cookie = ' + cookie_value;
 
     data = request.server.stash.take(id)
     if data is not None:
         line = data + "\n" + line
 
     request.server.stash.put(id, line)
 
     if "redirect" in request.GET: