Skip to content

HTTP request failed #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
theodorebourgeon opened this issue Nov 20, 2023 · 1 comment
Open

HTTP request failed #94

theodorebourgeon opened this issue Nov 20, 2023 · 1 comment

Comments

@theodorebourgeon
Copy link

When I try to get an HTTP url (i.e http://facebook.com) it raises an error instead or redirecting to HTTPS:

TLSClientExeption: failed to do request: Get "http://facebook.com": net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x00\x00\x12\x04\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00d\x00\x04\x00\x01\x00\x00\x00\x05\x00\xff\xff\xff\x00\x00\x04\b\x00\x00\x00\x00\x00\x7f\xff\x00\x00\x00\x00\b\a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"

Step to reproduce
import tls_client response = session.get("http://facebook.com", headers= { "upgrade-insecure-requests": "1", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Windows; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.138 Safari/537.36", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "sec-ch-ua": '".Not/A)Brand";v="99", "Google Chrome";v="112", "Chromium";v="112"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"Windows"', "sec-fetch-site": "none", "sec-fetch-mod": "", "sec-fetch-user": "?1", "accept-encoding": "gzip, deflate, br", "accept-language": "bg-BG,bg;q=0.9,en-US;q=0.8,en;q=0.7", }, timeout_seconds=10, allow_redirects=True)

@qoft
Copy link
Contributor

qoft commented Jan 16, 2024

Please use https://facebook.com instead of http://facebook.com
Should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants