Skip to content

Commit

Permalink
Set a user-agent header for SFX requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 22, 2024
1 parent 5e0f05f commit 6a313e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/sfx_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def sfx_response
Faraday.new(url: sfx_url) do |faraday|
faraday.use FaradayMiddleware::FollowRedirects
faraday.adapter Faraday.default_adapter
# Set the user agent
faraday.headers['User-Agent'] = 'Mozilla/5.0 (compatible; +https://searchworks.stanford.edu)'
end.get
rescue Faraday::ConnectionFailed
Honeybadger.notify("SFX data for #{sfx_url} failed to load")
Expand Down

0 comments on commit 6a313e5

Please sign in to comment.