Skip to content

Commit 6d9b1ef

Browse files
committed
Spoof user agent when downloading GIAS data
Without this the script seems to fail with a forbidden HTTP status code. ``` /usr/local/bundle/ruby/3.4.0/gems/mechanize-2.14.0/lib/mechanize/http/agent.rb:340:in 'Mechanize::HTTP::Agent#fetch': 403 => Net::HTTPForbidden for https://get-information-schools.service.gov.uk/Downloads -- unhandled response (Mechanize::ResponseCodeError) ```
1 parent c6abeb5 commit 6d9b1ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/lib/mavis_cli/gias/download.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def call
1919

2020
puts "Starting schools data download process..."
2121
agent = Mechanize.new
22+
agent.user_agent_alias = "Mac Safari"
2223

2324
puts "Visiting the downloads page"
2425
page =

0 commit comments

Comments
 (0)