You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note this only happens when the source request is in the RequestInit position (see below).
I found #10286, but this situation really has nothing to do with request.cache, the clone should succeed, and later throw if and only if cache is accessed.
// tmp.tsconstport=parseInt(Deno.args[0]);constlistener=Deno.listen({port: port});fetch(`http://localhost:${port}`).then(r=>console.log(r)).catch(e=>console.error(e));forawait(constconnoflistener){(async()=>{forawait(const{ request, respondWith }ofDeno.serveHttp(conn)){(requestasany).foo=true;// const reqCopy = new Request(request); // this succeedsconstreqCopy=newRequest(request.url,request);// this throwsrespondWith(newResponse(`${reqCopy.url}`));}})();}
deno run --unstable --allow-net tmp.ts 3333
error: Uncaught (in promise) TypeError: This property is not implemented.
const reqCopy = new Request(request.url, request); // this throws
^
at Request.get cache (deno:op_crates/fetch/23_request.js:343:13)
at Array.RequestInit (deno:op_crates/webidl/00_webidl.js:661:33)
at new Request (deno:op_crates/fetch/23_request.js:198:46)
at tmp.ts:11:29
The text was updated successfully, but these errors were encountered:
error: Uncaught (in promise) TypeError: This property is not implemented.
const reqCopy = new Request(request.url, request); // this throws
^
at Request.get cache (deno:extensions/fetch/23_request.js:346:13)
at Array.RequestInit (deno:extensions/webidl/00_webidl.js:661:33)
at new Request (deno:extensions/fetch/23_request.js:198:46)
at tmp.ts:12:29
johnspurlock
changed the title
Cloning a request with an additional property throws an unrelated error in 1.9.2
Cloning a request with an additional property throws an unrelated error in 1.9.2 – 1.10.2
May 19, 2021
Note this only happens when the source request is in the
RequestInit
position (see below).I found #10286, but this situation really has nothing to do with
request.cache
, the clone should succeed, and later throw if and only if cache is accessed.This did not throw in 1.9.0.
deno run --unstable --allow-net tmp.ts 3333
The text was updated successfully, but these errors were encountered: