forked from OpenNeo/impress
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:
parent
d50672fd73
commit
eb5f2a020c
1 changed files with 3 additions and 1 deletions
|
@ -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})"
|
||||
|
|
Loading…
Reference in a new issue