Description of problem
Current docs recommend:
$ curl -o pub.key https://access.redhat.com/security/data/fd431d51.txt
But in 2024-09, that content was moved to a new location (with a 301 redirect), and the currently-doc'ed command (which does not allow redirects) will exit 0 (success) while downloading an empty file:
$ curl -o pub.key https://access.redhat.com/security/data/fd431d51.txt % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 $ echo $? 0 $ wc -l pub.key 0 pub.key
We should pivot to the new canonical location. And we should add the L/-location option to protect ourselves from future moves.
$ man curl | grep -1 'moved to a different location' -L, --location (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place. If used together with -i, --include or -I, --head, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the ini‐
Version-Release number of selected component
All versions of the docs that are still supported; this is old doc source that's affected.
How reproducible
Every time.
Steps to Reproduce
Run the recommended curl.
Actual results
Empty pub.key.
Expected results
Populated pub.key.
Additional info
$ curl -isL https://access.redhat.com/security/data/fd431d51.txt | grep -i 'HTTP\|Location\|PUBLIC' HTTP/2 301 location: https://security.access.redhat.com/data/fd431d51.txt HTTP/1.1 200 OK -----BEGIN PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----