blob: cf8ed5e49244a614dbe44acf2dc9146629e79290 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
def main(request, response):
allow = request.GET.first(b"allow", b"false")
headers = [(b"Content-Type", b"application/javascript")]
if allow != b"false":
headers.append((b"Access-Control-Allow-Origin", b"*"))
body = b"""
function handleRejectedPromise(promise) {
promise.catch(() => {});
}
(function() {
new Promise(function(resolve, reject) { reject(42); });
})();
"""
return headers, body
|