summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py')
-rw-r--r--testing/web-platform/tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py b/testing/web-platform/tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py
new file mode 100644
index 0000000000..1931c77b67
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/bytecheck-worker-imported-script.py
@@ -0,0 +1,20 @@
+import time
+
+def main(request, response):
+ headers = [(b'Content-Type', b'application/javascript'),
+ (b'Cache-Control', b'max-age=0'),
+ (b'Access-Control-Allow-Origin', b'*')]
+
+ imported_content_type = b''
+ if b'imported' in request.GET:
+ imported_content_type = request.GET[b'imported']
+
+ imported_content = b'default'
+ if imported_content_type == b'time':
+ imported_content = b'%f' % time.time()
+
+ body = b'''
+ // %s
+ ''' % (imported_content)
+
+ return headers, body