juliaup
juliaup copied to clipboard
Add User-Agent header to HTTP requests
Some Web Application Firewalls (like CloudFront used by JuliaHub) block requests without a User-Agent header, returning 403 Forbidden. This caused confusing "Failed to get etag" errors when using JULIAUP_SERVER with alternate mirrors.
Add a helper function http_client() that creates a reqwest client with a proper User-Agent header (juliaup/{version}), and use it for all HTTP requests on non-Windows platforms. Likewise for the windows HTTP client.