MCPcopy Create free account
hub / github.com/nodejs/node / responseURL

Function responseURL

deps/undici/src/lib/web/fetch/util.js:15–22  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

13const { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require('../infra')
14
15function 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
25function responseLocationURL (response, requestFragment) {

Callers 1

responseLocationURLFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected