Telodendria Bot can now send messages again.

The problem here is that some Matrix homeservers reject requests that don't
have a Content-Length. http was not sending a Content-Length because it was
reading from standard input. By reading from an actual file, we can actually
easily get the size of the file to send as the Content-Length.
This commit is contained in:
Jordan Bancino 2023-06-12 14:01:56 +00:00
parent 2b3d0aaeaf
commit 2f946848cb

View file

@ -30,7 +30,9 @@ matrix_send() {
printf ',"format":"org.matrix.custom.html",' printf ',"format":"org.matrix.custom.html",'
printf '"msgtype":"m.text"' printf '"msgtype":"m.text"'
printf '}' printf '}'
) | http -X PUT -d @- "$HOMESERVER/client/v3/rooms/$PATCHES_ROOM/send/m.room.message/$(date +%s)?access_token=$ACCESS_TOKEN" ) > /tmp/tp-$$
http -X PUT -d @/tmp/tp-$$ "$HOMESERVER/client/v3/rooms/$PATCHES_ROOM/send/m.room.message/$(date +%s)?access_token=$ACCESS_TOKEN"
rm /tmp/tp-$$
fi fi
} }