Skip to content

Commit 5fcf9c5

Browse files
jazairiCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 5788f3f commit 5fcf9c5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/controllers/thirdiron_controller_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ class ThirdironControllerTest < ActionDispatch::IntegrationTest
131131
end
132132
end
133133

134+
test 'browzine route ignores unsafe full_record_url values' do
135+
VCR.use_cassette('browzine issn') do
136+
get '/browzine?issn=1546170X&full_record_url=javascript:alert(1)'
137+
138+
assert_response :success
139+
140+
# Unsafe URL should not produce a "Full-text options" button
141+
assert_select 'a.button', { count: 0 }
142+
assert_select 'a.libkey-link', { count: 1 }
143+
end
144+
end
145+
134146
test 'browzine route for non-existent issn returns blank' do
135147
# Browzine responds here, so we have a cassette - but the response is empty
136148
VCR.use_cassette('browzine nonexistent') do

0 commit comments

Comments
 (0)