PostIt: negotiate HTTP/3 (QUIC) for Yavsc API calls

Set DefaultRequestVersion = 3.0 and DefaultVersionPolicy =
RequestVersionOrLower on the shared YavscApiClient.Http instance, so all
Yavsc.Api.Client traffic prefers HTTP/3 against the nginx edge vhosts
(listen 443 quic ; http3 on ; Alt-Svc) and falls back to h2/h1.1 where
QUIC isn't available (WASM fetch, Android/desktop without libmsquic).

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Paul Schneider 2026-09-25 19:12:47 +01:00
commit 8d2d6754f6
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12

View file

@ -49,6 +49,16 @@ public class YavscApiClient : IYavscApiClient, IAsyncDisposable
_bearer = new BearerTokenHandler(this); _bearer = new BearerTokenHandler(this);
Http = new HttpClient(_bearer, disposeHandler: true); Http = new HttpClient(_bearer, disposeHandler: true);
// HTTP/3 (QUIC) vers les APIs Yavsc : le edge nginx termine h3 sur
// tous les vhosts (listen 443 quic ; http3 on ; Alt-Svc h3=":443").
// RequestVersionOrLower négocie h3 quand le serveur ET la plateforme
// le permettent (Desktop avec libmsquic), et retombe sur h2/h1.1
// sinon — notamment WASM, où le navigateur n'expose pas QUIC au
// fetch, et Android si libmsquic n'est pas disponible. Tous les
// clients Yavsc.Api.Client partagent cette même instance `Http`.
Http.DefaultRequestVersion = new Version(3, 0);
Http.DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrLower;
_tokens = store.Load(); _tokens = store.Load();
} }