Add User-Agent header to our NeopetsMediaArchive requests

Note: I validated this was working by temporarily changing the URI to
`https://echo.free.beeceptor.com`, which echoes the headers back, then
called `NeopetsMediaArchive.load_file_from_origin` directly.
This commit is contained in:
Emi Matchu 2024-04-09 06:58:03 -07:00
parent d50672fd73
commit eb5f2a020c
1 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,9 @@ module NeopetsMediaArchive
# We use this in the `swf_assets:manifests:load` task to perform many
# requests in parallel!
Sync do
response = INTERNET.get(uri)
response = INTERNET.get(uri, [
["User-Agent", Rails.configuration.user_agent_for_neopets],
])
if response.status != 200
raise ResponseNotOK.new(response.status),
"expected status 200 but got #{response.status} (#{uri})"