Error when headers return 'Location' as an app://xxxx although I have set disable redirects  

<!-- Summary. -->

## Expected Result
response['Location'] = app://xxxx
<!-- What you expected. -->

## Actual Result
hostIP = socket.gethostbyname(hostonly)
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label too long)

<!-- What happened instead. -->

## Reproduction Steps

```python
import requests
resp = requests.get('https://example', allow_redirects=False)

```


<!-- This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c). -->


Hi @KenKout, can you please supply the full set of information requested in the ticket template and the complete stacktrace?

What's provided currently is not reproducible.

This works as expected:
```python
import requests
r = requests.get('https://httpbin.org/redirect-to?url=app://test', allow_redirects=False)
```

From the error, it looks like the location is being parsed at some point, it's not clear where that's happening.

```python
import requests
from requests.structures import CaseInsensitiveDict

url = "https://sandbox.moodledemo.net/login/index.php"
s = requests.Session()
headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
headers["Origin"] = "https://sandbox.moodledemo.net"
headers["Referer"] = "https://sandbox.moodledemo.net/login/index.php"
headers["User-Agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"


resp = s.get(url, headers=headers)
logintoken = resp.text.split('logintoken" value="')[1].split('"')[0]
data = f"anchor=&logintoken={logintoken}&username=admin&password=sandbox"
resp = s.post(url, headers=headers, data=data)
print(resp.text)

url = 'https://sandbox.moodledemo.net/admin/tool/mobile/launch.php?service=moodle_mobile_app&passport=1&urlscheme=moodlemobile'
resp = s.get(url, headers=headers)
print(resp.text)
```

Hi, this is the script, sorry for late response
It works well when I use library httpx

```python
import requests
from requests.structures import CaseInsensitiveDict

url = "https://sandbox.moodledemo.net/login/index.php"
s = requests.Session()
headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
headers["Origin"] = "https://sandbox.moodledemo.net"
headers["Referer"] = "https://sandbox.moodledemo.net/login/index.php"
headers["User-Agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"


resp = s.get(url, headers=headers)
logintoken = resp.text.split('logintoken" value="')[1].split('"')[0]
data = f"anchor=&logintoken={logintoken}&username=admin&password=sandbox"
resp = s.post(url, headers=headers, data=data)
print(resp.text)

import httpx
url = 'https://sandbox.moodledemo.net/admin/tool/mobile/launch.php?service=moodle_mobile_app&passport=1&urlscheme=moodlemobile'
resp = httpx.get(url, headers=headers, cookies=s.cookies)
print(resp.headers)
```


In case you can't try to recreate the error, it's because moodle sandbox resets every hour
So when you want to try it
[Moodle Setting](https://sandbox.moodledemo.net/admin/settings.php?section=mobileauthentication)
(username: _admin_; password: _sandbox_)
Come to this page and change _Type of login_ into this
<img width="1008" alt="image" src="https://github.com/psf/requests/assets/54569460/2aee052b-acd6-4de1-9a87-4ede86b3d6cc">


@KenKout you're not setting allow_redirects in your example and you still haven't provided any of the information in the issue template that's required.