You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
In fact, there's an assumption on AnkiConnect that the Content-Length header is on camel case.
That will break the behavior when you use a lib which doesn't write the headers like that.
That is the case when you use the node request (https://github.com/request/request) lib to call AnkiConnect.
I've wiresharked it and compared with a request made with Postman and found out it was the Content-Length header's fault, which was being sent as content-length.
AnkiConnect will use 0 as body length, bodyLength = int(headers.get(makeBytes('Content-Length'), 0)) (https://github.com/FooSoft/anki-connect/blob/master/AnkiConnect.py#L186) and will then return the default string AnkiConnect v.4 (due to if len(req.body) == 0: on https://github.com/FooSoft/anki-connect/blob/master/AnkiConnect.py#L259)
I'm already working on a Pull Request to make them case insensitive.
The text was updated successfully, but these errors were encountered:
In fact, there's an assumption on AnkiConnect that the
Content-Length
header is on camel case.That will break the behavior when you use a lib which doesn't write the headers like that.
That is the case when you use the node
request
(https://github.com/request/request) lib to call AnkiConnect.I've wiresharked it and compared with a request made with Postman and found out it was the
Content-Length
header's fault, which was being sent ascontent-length
.AnkiConnect will use 0 as body length,
bodyLength = int(headers.get(makeBytes('Content-Length'), 0))
(https://github.com/FooSoft/anki-connect/blob/master/AnkiConnect.py#L186) and will then return the default stringAnkiConnect v.4
(due toif len(req.body) == 0:
on https://github.com/FooSoft/anki-connect/blob/master/AnkiConnect.py#L259)I'm already working on a Pull Request to make them case insensitive.
The text was updated successfully, but these errors were encountered: