-
Notifications
You must be signed in to change notification settings - Fork 25
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
get_content_url(follow_redirects=True) should stop when reaching a "folder" #980
Comments
@yarikoptic I don't think it makes much sense to call |
Well, I guess it is just a matter of generic programming to be able to request target content URL regardless of its type |
@yarikoptic I'm not clear on what you're saying. Are you still asking for the change described in the original comment or something else? |
Yes, I think it would be a good idea for function to not crash - let's just not try following redirects on s3 folders |
@yarikoptic So what exactly do you want the new behavior to be? Should it be that, if an HTTP error response is returned for a URL that ends in a slash, the URL is returned instead of erroring? |
@yarikoptic Ping; please respond to last comment. |
I think "the URL is returned instead of erroring" would provide us the desired effect here. |
@yarikoptic Note that the code currently just takes a URL from the asset metadata and lets |
@yarikoptic I still need an answer to my last comment. |
just return the last URL for which |
get_content_url(): If a HEAD fails, return the failing URL
🚀 Issue was released in |
Discovered by @satra .
ATM for a zarr it would try to follow through with the HEAD request for the "folder" and that pukes. I think it should be ok to catch that exception and if URL already ends with
/
then just stop at that URL. Or may be @jwodder you see a better/more standardized way?A sample case:
the question is either we should not bother redirecting for any
/
or only for the urls from thes3.amazonaws.com
subdomains since we know that there is no real "folder/" on S3 (although "folder" key could exist)... for now I think we could stop following for any/
urlThe text was updated successfully, but these errors were encountered: