Comments (9)
I don't believe the library should transparently follow redirects in this case.
As a user, you may not realize what's
happening and you'll be constantly making twice as many requests as you need.
Better I think for an exception to be thrown and for you to be made aware of
the situation so you can enable
UseSubdomains.
I do think this situation could be detected though and a better error message
thrown.
Original comment by [email protected]
on 4 Aug 2009 at 9:12
from lits3.
I believe you are right that the redirects needs to be non-transparent. I do
believe
that this is a common case for any consumer of LitS3, and as of such a
situation the
library needs to handle.
I propose the introducing of a `AllowRedirect` for the request class that do
not only
allow HTTP redirect, but also follow Amazon redirects. A similar property, if
the
request was redirected, could be placed on the response.
Please note that this error could occur, even if `UseSubdomains` is enabled, as
the S3
infrastructure may not create CNAME's immediately or could remap this, if a
bucket is
recreated in another availability zone.
As a permanent redirect don't require that you enable `UseSubdomains` (only
that you
resend the request against the specified host (which as written above could
differ from
the subdomain URL), I believe these redirects should be cached, so future
requests will
hit the right server.
Original comment by [email protected]
on 5 Aug 2009 at 5:12
from lits3.
This is actually quite urgent, as even when creating new Buckets and having
UseSubdomains set to True, Amazon is giving me a temporary redirect with the
following message:
"Please re-send this request to the specified temporary endpoint. Continue to
use the
original request endpoint for future requests."
I assume this is when they haven't yet created the main subdomain. According to
Amazon this is quite normal:
http://docs.amazonwebservices.com/AmazonS3/latest/index.html?Redirects.html
Would be great to get this case at least fixed or resolved.
Original comment by [email protected]
on 8 Aug 2009 at 5:09
from lits3.
I'm afraid I still don't quite understand the problem - you're saying that
there's no way to configure LitS3 to work
properly with your particular bucket?
Original comment by [email protected]
on 14 Aug 2009 at 8:41
from lits3.
nfarina, that is correct.
When you create a new bucket in the EU zone, you will get a temporary redirect
on
each request, as the CNAME takes time the propagate. It is actually explained
by
Amazon in the link above:
http://docs.amazonwebservices.com/AmazonS3/latest/index.html?Redirects.html
You could get LitS3 to work with this, but it requires the following steps
(which is
really something the library should handle, not the consumer):
1. Send a request.
2. Catch the thrown exception.
3. Parse the exception to extract the temporary hostname from it.
4. Resend the request to the new endpoint.
When implementing a fix for this in LitS3, it could be hard to test, as the
CNAME
propagation time can vary. I would suggest using my steps in the issue report,
as
this will trigger the same behaviour.
LitS3 is by far the S3 library in C# with the best coding, but the lack of this
feature makes it useless for software where you have to create new buckets in
the EU
and use these immediately (unless you implement the logic, that I suggest is
common
for all LitS3 consumers).
Original comment by [email protected]
on 22 Aug 2009 at 5:34
from lits3.
Thanks for being patient with me, I finally understand and can reproduce this
problem. It's a bit tricky ... right
now I'm trying to figure out how to transparently resend the original request
without having to recreate it and do
a deep copy.
Original comment by [email protected]
on 23 Aug 2009 at 8:20
from lits3.
Looks like it's not possible for the .NET framework to transparently handle
redirects because the request needs
to be resigned with the new endpoint.
This will involve some big changes to LitS3 architecture since new
HttpWebRequest objects will need to be
created automatically. still ruminating…
Original comment by [email protected]
on 23 Aug 2009 at 9:08
from lits3.
Amazon has just released a new SDK that supports redirection. You may find some
inspiration about the handling in their source (released under the Apache
License 2.0).
Here is a link for the announcement:
http://aws.typepad.com/aws/2009/11/new-aws-sdk-
for-net-developers.html
Original comment by [email protected]
on 12 Nov 2009 at 9:33
from lits3.
Any news on this? I use LitS3 extensively, and many people who use my library
with LitS3 run into the redirects problem. Also, is it still a good idea to let
UseSubdomains default to false? It breaks non-us buckets *always*, and I
haven't heard/seen what the numbers are on breakage when setting it to true...
Original comment by [email protected]
on 4 Jan 2012 at 11:41
from lits3.
Related Issues (20)
- UseSubdomains is false per default HOT 3
- Problem uploading large file HOT 6
- Avoid escaping '/' in key HOT 1
- Return Uri instances instead of string values HOT 3
- The GetObjectStream method doesn't return full stream (only get a few lines of the file) HOT 1
- How to use Browser-Based Uploads Using POST with the LitS3 Library
- Support for browser based uploads?
- slow upload performance on windows 2003 HOT 1
- Creating subfolders HOT 4
- Recomendation
- S3Authorizer.signer is never disposed HOT 1
- Add support for new versioning of Object
- S3 Keys containing a period are not encoded correctly
- Unable to set the Host to the West region - s3-us-west-1.amazonaws.com
- Enable support for reduced redundancy storage
- Nuget Support
- Patch to Submit : Signed Header Request
- Uses culture-sensitive number and date methods
- Header param x-amz-copy-source must be URL encoded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lits3.