Add new HTTP helpers#59
Conversation
ba2c8ad to
44270ce
Compare
44270ce to
d323e07
Compare
bf4fbee to
efc0e06
Compare
|
Since we tested this with the Matrix bridge and it works as expected I guess we can merge this now? |
I still need to add docs in docs/development/protocol.md Otherwise i think it's working as expected. I'd like to have opinions from other bridge contributors before merging, but i don't think it's required. |
|
This has been successfully tested with #23 and #61 in #63. I should just add some docs in the "building a new protocol/bridge" docs about the new helpers. Another feedback was that failure to download the attachment produces a silent error in bridge rooms and is only visible in matterbridge logs: I'm not sure if it's better to silently discard the message (as was the case previously), or to relay in remote chatrooms an error message that random users (especially those not familiar with matterbridge or attachment handling in general) may find confusing. Maybe that could be a setting. Also worth noting that this behavior can be improved upon:
|
3a71ffb to
a4b069c
Compare
a4b069c to
81c1195
Compare
|
Read for review @poVoq |
There's now a single HTTP client for each bridge, instead of creating a new one on every request. Proxy settings are applied per bridge, and the
NewHttpRequestmethod can be overridden by each bridge to add headers (eg. tokens/cookies).As a bonus, the regexes are precompiled and not recompiled in the hotloop of parsing attachments.
This should be tested before merging!