Re: [whatwg/fetch] Proposal: Easier request/response rewrites (#671)

thinking this would be useful also, but in my current case it was not about rewriting but instead construct and mock a response object...

```js
var res = new Response('', { url: 'https://example.com' })
console.log(res.url) // ""
res.url = 'https://example.com'
console.log(res.url) // ""
```
Why don't this work? I basically have to redefine or use a Proxy:
```js
Object.defineProperty(res, 'url', { value: 'https://example.com' })
console.log(res.url) // "https://example.com"
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/671#issuecomment-629525996

Received on Friday, 15 May 2020 22:16:37 UTC