-
-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Describe the bug
I am building a Python app and part of it interfaces with the Adoptium API. Using the Requests library, which sends user-agent python-requests/2.31.0
by default, gives a 403 forbidden error. Not sending a user-agent at all also causes a 403 forbidden. Setting the user-agent to something else fixes the issue, but it shouldn't be a necessary workaround, any user-agent should be allowed.
To Reproduce
pip install requests
- Write a file like this:
import requests
resp = requests.get("https://api.adoptium.net/v3/info/available_releases")
print(resp.request.headers)
print(resp.headers)
print(resp.status_code)
print(resp.text)
- Run it. Observe 403 error (e.g. first screenshot)
- Change second line of file to be like this:
resp = requests.get("https://api.adoptium.net/v3/info/available_releases", headers={"User-Agent": "Dummy"})
- Run it again. Observe it works. Wow!
Expected behavior
It works with the default requests config
Screenshots
Doesn't work with the regular header.
Works when you put some random one. Crazy stuff, one http header is the entire difference between failure and success.
Device (please complete the following information):
- OS: macOS Ventura 13.3.1
- Browser: N/A
- Version: N/A
Additional context
Looks to be an azure misconfiguration. Also this happened before but it wasn't fixed properly.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status