Repositories don't make use of "?mediahandler=curl2"

The openSUSE-repos-Tumbleweed package installs repos with mediahandler=curl2 but falls back to curl 1.1

dart@windeath:~> curl -sI http://cdn.opensuse.org/update/tumbleweed?mediahandler=curl2 -o/dev/null -w '%{http_version}\n'
1.1

The easy way to fix this is use https in the url

dart@windeath:~> curl -sI https://cdn.opensuse.org/update/tumbleweed?mediahandler=curl2 -o/dev/null -w '%{http_version}\n'
2

Explicitly asking it to use curl2 doesn’t help with http urls

dart@windeath:~> curl -sI  --http2 http://cdn.opensuse.org/update/tumbleweed?mediahandler=curl2 -o/dev/null -w '%{http_version}\n'
1.1

From the curl page:

curl supports HTTP/2 for both HTTP:// and HTTPS:// URLs assuming that curl was built with the proper prerequisites. It even defaults to using HTTP/2 when given an HTTPS URL since doing so implies no penalty and when curl is used with sites that do not support HTTP/2 the request instead negotiates HTTP/1.1.
With HTTP:// URLs however, the upgrade to HTTP/2 is done with an Upgrade: header that may cause an extra round-trip and perhaps even more troublesome, a sizable share of old servers returns a 400 response when seeing such a header.

Is this an actual bug in the package or am I missing something?

Also just updated to the new TW snapshot and if you use “https” the “?mediahandler=curl2” appended to the repository url is not necessary … curl will do it automatically

dart@windeath:~/Downloads> curl -sI  https://cdn.opensuse.org/update/tumbleweed -o/dev/null -w '%{http_version}\n'
2

That is if your curl is compiled with http2 support which for TW … it is

dart@windeath:~/Downloads> curl -V
curl 8.13.0 (x86_64-suse-linux-gnu) libcurl/8.13.0 OpenSSL/3.2.4 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.5 libssh/0.11.1/openssl/zlib nghttp2/1.64.0 OpenLDAP/2.6.8
Release-Date: 2025-04-02
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

What makes you think this parameter has anything to do with HTTP version?

Because putting ?mediahandler=curl2 on a http url instead of https just defaults back to http1.1 anyway and because curl attempts to reuse connections when doing multiple transfers, so getting many files from doesn’t result in multiple connect and setup handshakes and http2.0 is much better for that with multiple streams?

Maybe because if that http1.1 server had an

Upgrade: header that may cause an extra round-trip and perhaps even more troublesome

Or maybe because I already have download.max_concurrent_connections = 12 and I’ve maxed out my connection so ?mediahandler=curl2 does me no good anyway

Or maybe because it’s probably :thinking: an easy fix to simply make the Tumbleweed Repos package use https instead?

I’m done … bedtime now