vasinkd · GitHub

Ok. I guess it is almost the final version.

This code can be executed with Python 2.7, Python 3.4+ and (probably) PyPy.
It fixes #1189

Now it returns a little different HTTP status codes: 500 (used to be 403) if Content-Length header is not readable and 404 (used to be 200, why?) if someone uses not POST-request or incorrect URL. It may be easily changed if necessary.

Also, SSL-Certificate check is provided by ssl_ctx.load_cert_chain(cert, key) which has OpenSSL under the hood. I removed _check_ssl_cert function in favor of this method.

I didn't understand what to do with tests aimed at Telegram API 4.0 coverage. Should I comment them out?

Read the original on github.com ↗