Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal HEAD request not working with Pre-signed URLs #189

Open
mhluska opened this issue Nov 26, 2017 · 1 comment
Open

Internal HEAD request not working with Pre-signed URLs #189

mhluska opened this issue Nov 26, 2017 · 1 comment

Comments

@mhluska
Copy link

mhluska commented Nov 26, 2017

It looks like only URLs without query params are supported. The gem seems to toss away the query part which may result in 403 errors for Amazon S3 resources where the auth token is part of the query param. On top of that, the gem just throws a "the file does not exist" error which totally obscures the 403 code.


As a workaround, I'm doing this:

def ffmpeg_video_from_remote(remote_file_url)
  open(File.join('public', file.file.filename), 'wb') do |file|
    file << open(remote_file_url).read
    FFMPEG::Movie.new(Rails.root.join(file.path).to_s)
  end
end

Edit: I was wrong. It looks like the query params do get used but what is happening is my pre-signed URL to Amazon S3 is only meant to be used with GET but the library does a HEAD request.

@mhluska mhluska changed the title Preserve Query Params Internal HEAD request not working with Pre-signed URLs Dec 4, 2017
@atash66
Copy link

atash66 commented Dec 14, 2017

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants