diff options
Diffstat (limited to 'tools/video-compress-test.js')
| -rw-r--r-- | tools/video-compress-test.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/video-compress-test.js b/tools/video-compress-test.js index ce1a936..c1175f8 100644 --- a/tools/video-compress-test.js +++ b/tools/video-compress-test.js @@ -40,7 +40,7 @@ await page.evaluateOnNewDocument(() => { const open = XMLHttpRequest.prototype.open, send = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.open = function (m, url) { this.__m = m; this.__url = String(url); return open.apply(this, arguments); }; XMLHttpRequest.prototype.send = function (body) { - if (this.__m === 'PUT' && /nostr\.build|nostr\.download/.test(this.__url) && body instanceof Blob) { + if (this.__m === 'PUT' && /blossom\.ditto\.pub|blossom\.primal\.net|nostr\.build|nostr\.download/.test(this.__url) && body instanceof Blob) { body.arrayBuffer().then((buf) => { window.__put = { size: body.size, type: body.type, buf }; }); } return send.apply(this, arguments); @@ -56,7 +56,7 @@ await page.evaluateOnNewDocument(() => { await page.setRequestInterception(true); page.on('request', (req) => { const u = req.url(); - if (!/nostr\.build|nostr\.download/.test(u)) return req.continue(); + if (!/blossom\.ditto\.pub|blossom\.primal\.net|nostr\.build|nostr\.download/.test(u)) return req.continue(); const cors = { 'access-control-allow-origin': '*', 'access-control-allow-methods': 'PUT, HEAD, GET', 'access-control-allow-headers': '*' }; if (req.method() === 'OPTIONS') return req.respond({ status: 204, headers: cors }); if (req.method() === 'HEAD') return req.respond({ status: 200, headers: cors }); |
