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

Method url

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

Source from the content-addressed store, hash-verified

155
156 // Returns response’s URL, if it has one; otherwise the empty string.
157 get url () {
158 webidl.brandCheck(this, Response)
159
160 const urlList = this.#state.urlList
161
162 // The url getter steps are to return the empty string if this’s
163 // response’s URL is null; otherwise this’s response’s URL,
164 // serialized with exclude fragment set to true.
165 const url = urlList[urlList.length - 1] ?? null
166
167 if (url === null) {
168 return ''
169 }
170
171 return URLSerializer(url, true)
172 }
173
174 // Returns whether response was obtained through a redirect.
175 get redirected () {

Callers

nothing calls this directly

Calls 2

brandCheckMethod · 0.80
URLSerializerFunction · 0.70

Tested by

no test coverage detected