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

S3: Streaming response (get) does not work with redirect #153

Open
tkoenig opened this issue Nov 26, 2012 · 1 comment
Open

S3: Streaming response (get) does not work with redirect #153

tkoenig opened this issue Nov 26, 2012 · 1 comment

Comments

@tkoenig
Copy link

tkoenig commented Nov 26, 2012

If you are using for example the european S3 Server for your bucket location, a streaming response will fail unless you explicitly set the correct server.

I'm not sure if this is an issue, but I think at least there could be a hint in the documentation for this.

Example (not working)

s3 = RightAws::S3Interface.new(key, secret)

#Using a bucket in Ireland
s3.get(bucket, 'example.jpg') do |chunk|
  puts "got chunk"
end
I, [2012-11-26T12:15:48.100871 #35107]  INFO -- : New RightAws::S3Interface using shared connections mode
I, [2012-11-26T12:15:48.101428 #35107]  INFO -- : Opening new HTTPS connection to bucket.s3.amazonaws.com:443
I, [2012-11-26T12:15:49.063040 #35107]  INFO -- : ##### RightAws::S3Interface redirect requested: 307 Temporary Redirect #####
I, [2012-11-26T12:15:49.063101 #35107]  INFO -- :       Old location: https://bucket.s3.amazonaws.com:443/example.jpg
I, [2012-11-26T12:15:49.063128 #35107]  INFO -- :       New location: https://bucket.s3-external-3.amazonaws.com/example.jpg
I, [2012-11-26T12:15:49.063154 #35107]  INFO -- :       Request Verb: Net::HTTP::Get
I, [2012-11-26T12:15:49.063499 #35107]  INFO -- : ##### Retry #1 is being performed due to a redirect.  ####
I, [2012-11-26T12:15:49.063643 #35107]  INFO -- : Opening new HTTPS connection to bucket.s3-external-3.amazonaws.com:443

Example (working)

s3 = RightAws::S3Interface.new(key, secret, :server => 's3-external-3.amazonaws.com'})
s3.get(bucket, 'example.jpg') do |chunk|
  puts "got chunk"
end
I, [2012-11-26T12:19:29.516448 #35150]  INFO -- : New RightAws::S3Interface using shared connections mode
I, [2012-11-26T12:19:29.517062 #35150]  INFO -- : Opening new HTTPS connection to bucket.s3-external-3.amazonaws.com:443
got chunk
got chunk
...
@esad
Copy link

esad commented Sep 10, 2013

+1

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