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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2019-11-15 19:44:34 +00:00
Родитель f918f7fc49
Коммит 014cc496af
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -31,9 +31,9 @@ def main(request, response):
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: