Lines like this in the repo:
only work because yum searches the URL for the 'metalink?' string. This behaviour makes processing the config files and setting up repositories quite complex. Let's start making this right by fixing the repo files, e.g. to something like:
Just committed a build changing mirrorlist to metalink in rawhide
Commit f19fc52 addresses this change in DNF (i.e. simplifies the repo configuration code).
Librepo, since 636e7ef, consider LRO_MIRRORLIST (the option that accepts mirrorlist url as well as metalink url) as s deprecated option and brings LRO_MIRRORLISTURL and LRO_METALINKURL instead.