Skip to content

Commit

Permalink
Merge pull request #2629 from BrianHawley/fixes_2625
Browse files Browse the repository at this point in the history
Support ssrf_filter 1.1
  • Loading branch information
mshibuya committed Nov 19, 2022
1 parent 32abf5b commit 674d757
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
${{ runner.os }}-gems-${{ matrix.ruby }}-
- name: Setup ImageMagick policy
run: sudo sh -c 'echo '\''<policymap><policy domain="coder" rights="read|write" pattern="PDF" /></policymap>'\'' > /etc/ImageMagick-6/policy.xml'
- name: Update package list
run: sudo apt update
- name: Install ghostscript to process PDF
run: sudo apt-get -y install ghostscript
- name: Install libvips-dev for Carrierwave::Vips
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source "https://rubygems.org"

gem "activemodel-serializers-xml"
# See https://github.com/fog/fog-google/issues/535 for this restriction.
gem "fog-google", "~> 1.13.0" if RUBY_VERSION.to_f < 2.6

gemspec
8 changes: 6 additions & 2 deletions lib/carrierwave/downloader/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ def download(url, remote_headers = {})
response = OpenURI.open_uri(process_uri(url.to_s), headers)
else
request = nil
response = SsrfFilter.get(uri, headers: headers) do |req|
request = req
if ::SsrfFilter::VERSION.to_f < 1.1
response = SsrfFilter.get(uri, headers: headers) do |req|
request = req
end
else
response = SsrfFilter.get(uri, headers: headers, request_proc: ->(req) { request = req })
end
response.uri = request.uri
response.value
Expand Down

0 comments on commit 674d757

Please sign in to comment.