Bug 1706661 [wpt PR 28625] - Don't try to set Access-Control-Allow-Origin to None in worklet tests, a=testonly

Automatic update from web-platform-tests
Don't try to set Access-Control-Allow-Origin to None in worklet tests

--

wpt-commits: cac1166c49e3aa511f8fd38ce0a5f588f9f145d4
wpt-pr: 28625
This commit is contained in:
James Graham 2021-04-24 09:15:24 +00:00 коммит произвёл moz-wptsync-bot
Родитель 8a766fb410
Коммит dda705f508
2 изменённых файлов: 14 добавлений и 2 удалений

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

@ -3,6 +3,12 @@ def main(request, response):
cookie = request.cookies.first(b"cookieName", None)
expected_value = request.GET.first(b"value", None)
source_origin = request.headers.get(b"origin", None)
if source_origin is None:
# Same origin GET won't include origin header
source_origin = "%s://%s" % (request.url_parts.scheme,
request.url_parts.netloc)
if request.url_parts.port:
source_origin += ":%s" % request.url_parts.port
response_headers = [(b"Content-Type", b"text/javascript"),
(b"Access-Control-Allow-Origin", source_origin),
@ -11,4 +17,4 @@ def main(request, response):
if cookie == expected_value:
return (200, response_headers, u"")
return (404, response_headers)
return (404, response_headers, u"")

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

@ -1,7 +1,13 @@
def main(request, response):
name = request.GET.first(b"name")
value = request.GET.first(b"value")
source_origin = request.headers.get(b"origin", None)
source_origin = request.headers.get(b"origin")
if source_origin is None:
# Same origin GET won't include origin header
source_origin = "%s://%s" % (request.url_parts.scheme,
request.url_parts.netloc)
if request.url_parts.port:
source_origin += ":%s" % request.url_parts.port
response_headers = [(b"Set-Cookie", name + b"=" + value),
(b"Access-Control-Allow-Origin", source_origin),