Skip to content

Commit

Permalink
VEBT-1165 Fix EightKeys file download URL (#1310)
Browse files Browse the repository at this point in the history
* VEBT-1165 Fix EightKeys file download URL

The current URL for the Eight Keys file requires following several redirects before the file is actually delivered. Since curl doesn't follow redirects by default, the wrong data is 'downloaded'. I.e. is the html of a 301 redirect page that is downloaded and treated as a xls file, which of course breaks things. The easy fix is to update the URL to the end of the redirect chain that actually delivers the file.

* fix no_key_api_downloader spec based on newly-implemented EightKey url
  • Loading branch information
thomaskrenzke authored Feb 10, 2025
1 parent f38a3c8 commit 76199e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/utilities/no_key_apis/no_key_api_downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NoKeyApiDownloader
'AccreditationAction' => [' -X POST', 'https://ope.ed.gov/dapip/api/downloadFiles/accreditationDataFiles'],
'AccreditationInstituteCampus' => [' -X POST', 'https://ope.ed.gov/dapip/api/downloadFiles/accreditationDataFiles'],
'AccreditationRecord' => [' -X POST', 'https://ope.ed.gov/dapip/api/downloadFiles/accreditationDataFiles'],
'EightKey' => [' -X GET', 'https://www2.ed.gov/documents/military/8-keys-sites.xls'],
'EightKey' => [' -X GET', 'https://www.ed.gov/sites/ed/files/documents/military/8-keys-sites.xls'],
'Hcm' => ['', 'https://studentaid.gov/sites/default/files/Schools-on-HCM-December2023.xlsx'],
'IpedsHd' => [' -X GET', 'https://nces.ed.gov/ipeds/datacenter/data/HD2022.zip'],
'IpedsIc' => [' -X GET', 'https://nces.ed.gov/ipeds/datacenter/data/IC2022.zip'],
Expand Down
2 changes: 1 addition & 1 deletion spec/utilities/no_key_apis/no_key_api_downloader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
expect(nkad.class_nm).to eq('EightKey')
expect(nkad.curl_command).to include('-X GET')
expect(nkad.curl_command).to include('tmp/eight_key.xls')
expect(nkad.curl_command).to include('https://www2.ed.gov/documents/military/8-keys-sites.xls')
expect(nkad.curl_command).to include('https://www.ed.gov/sites/ed/files/documents/military/8-keys-sites.xls')
expect(nkad.curl_command).not_to include('-d')
end

Expand Down

0 comments on commit 76199e6

Please sign in to comment.