Commit graph

13 commits

Author SHA1 Message Date
Joachim Bauch
147fb2305c
Don't update capabilities concurrently from same host.
If capabilities are expired and requested from multiple clients concurrently,
this could cause concurrent (duplicate) requests to the same Nextcloud host.
With this change, only a single request is sent to Nextcloud in such cases.
2024-10-09 15:37:08 +02:00
Joachim Bauch
03cad99b8d
Switch to "github.com/stretchr/testify" for tests. 2024-09-03 13:50:52 +02:00
Joachim Bauch
c93a9a6b75
Enforce a minimum duration to cache capabilities.
Simply using the values from the "Cache-Control" header is problematic
as recent setups of Nextcloud are not setting the header and capabilities
would not be cached at all in these cases.
2024-07-29 08:20:52 +02:00
Joachim Bauch
25cfad7519
Use default cache duration if no "Cache-Control" is included in the response. 2024-07-25 07:58:11 +02:00
Joachim Bauch
71ec43f0d2
Honor "no-cache" and "must-revalidate". 2024-07-25 07:56:57 +02:00
Joachim Bauch
a784ede8d4
Improve caching when fetching capabilities.
- Honor "max-age" in "Cache-Control" header.
- Use "ETag" to avoid fetching unmodified data.
2024-07-25 07:56:20 +02:00
Joachim Bauch
4b76a49355
Don't use unnecessary pointer to "json.RawMessage".
The slice is a pointer already.
2024-05-16 20:58:42 +02:00
Joachim Bauch
ea0d31b0dc
Fix potential race in capabilities test. 2024-05-13 13:16:49 +02:00
Joachim Bauch
0eb234b24d
Run tests in parallel and catch log output from tests. 2024-04-25 15:21:54 +02:00
Joachim Bauch
c134883138
Switch to atomic types from Go 1.19 2023-10-30 09:32:46 +01:00
Joachim Bauch
cbb6d9ca53
Update capabilities if no hello v2 token key is found in cache.
This is necessary to detect updated Talk setups where the signaling server
might have cached capabilities without the v2 token key but the clients
are trying to connect with a hello v2 token. Fetch updated capabilities in
such cases (but throttle to about one invalidation per minute).
2022-08-04 08:55:21 +02:00
Joachim Bauch
ec62503bd3
Support arbitrary capabilities values. 2022-07-04 13:53:02 +02:00
Joachim Bauch
79f7d85a53
Add tests for capabilities. 2022-05-13 10:16:45 +02:00