Return the base url of the given response, joined with the response url
(response: TextResponse)
| 26 | |
| 27 | |
| 28 | def get_base_url(response: TextResponse) -> str: |
| 29 | """Return the base url of the given response, joined with the response url""" |
| 30 | if response not in _baseurl_cache: |
| 31 | text = response.text[0:4096] |
| 32 | _baseurl_cache[response] = html.get_base_url( |
| 33 | text, response.url, response.encoding |
| 34 | ) |
| 35 | return _baseurl_cache[response] |
| 36 | |
| 37 | |
| 38 | _metaref_cache: WeakKeyDictionary[Response, tuple[None, None] | tuple[float, str]] = ( |
no outgoing calls