ba0f3 / telebot.nim

Async Telegram Bot API Client implement in @Nim-Lang
MIT License
165 stars 24 forks source link

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

Closed Michal-Szczepaniak closed 5 years ago

Michal-Szczepaniak commented 5 years ago

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

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

ba0f3 commented 5 years ago

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

Michal-Szczepaniak commented 5 years ago

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 commented 5 years ago

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

from strutils import strip
const API_KEY = slurp("secret.key").strip()
Michal-Szczepaniak commented 5 years ago

i have no idea why this worked but this worked

ba0f3 commented 5 years ago

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 commented 5 years ago

but i swear same file works on different pc lol

ba0f3 commented 5 years ago

strange.. but Im glad it worked ❤️