(response)
| 13 | const { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require('../infra') |
| 14 | |
| 15 | function responseURL (response) { |
| 16 | // https://fetch.spec.whatwg.org/#responses |
| 17 | // A response has an associated URL. It is a pointer to the last URL |
| 18 | // in response’s URL list and null if response’s URL list is empty. |
| 19 | const urlList = response.urlList |
| 20 | const length = urlList.length |
| 21 | return length === 0 ? null : urlList[length - 1].toString() |
| 22 | } |
| 23 | |
| 24 | // https://fetch.spec.whatwg.org/#concept-response-location-url |
| 25 | function responseLocationURL (response, requestFragment) { |
no test coverage detected