Skip to content
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

Error: Exception message: invalid http version, 0x7fdaa227cd50"<html>" #30

Closed
Michal-Szczepaniak opened this issue May 10, 2019 · 7 comments

Comments

@Michal-Szczepaniak
Copy link
Contributor

Exception message: invalid http version, 0x7fdaa227cd50"<html>" Exception type: [ProtocolError]

i compiled example but can't run it it throws straight this error

@ba0f3
Copy link
Owner

ba0f3 commented May 10, 2019

did you slurp secket.key file? if so, make sure no extra new line in your secket.key file

@Michal-Szczepaniak
Copy link
Contributor Author

Michal-Szczepaniak commented May 10, 2019

Yes i did and no there is no extra new line. Same code and same secret.key file works on different machine with different os (older package)

I should add
OS that code works on:
openSUSE Leap (fixed release)
OS that code doesn't work on
openSUSE Tumbleweed (rolling release so latest packages)

@ba0f3
Copy link
Owner

ba0f3 commented May 10, 2019

use strip from strutils to remove extra characters from secret key
for ex:

from strutils import strip
const API_KEY = slurp("secret.key").strip()

@ba0f3 ba0f3 closed this as completed May 10, 2019
@Michal-Szczepaniak
Copy link
Contributor Author

i have no idea why this worked but this worked

@ba0f3
Copy link
Owner

ba0f3 commented May 10, 2019

some time extra \r or \n or both added to url will makes HTTP requerst malformed. I think its a httpclient's bug.

@Michal-Szczepaniak
Copy link
Contributor Author

but i swear same file works on different pc lol

@ba0f3
Copy link
Owner

ba0f3 commented May 10, 2019

strange.. but Im glad it worked ❤️

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