-
Notifications
You must be signed in to change notification settings - Fork 155
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
Access Denied error when putting a file to a bucket with the same name #219
Comments
Nice,I encounted the same problem. It should report "bucket exists" error instead of "access denied". |
Osier, why "bucket exists" error when putting a file to a bucket with the same name? The operation should succeed. |
Oh, I misunderstood you, I meant I got same error message when creating a bucket which is already existing. |
Thank you for your report. I'll check this issue. |
@trociny Thank you for your contribution. I've checked and fixed this issue, which will be included in LeoFS v1.1.1. |
If a file name and name of the bucket where it is going to be put are the same, the operation fails with the error "Access Denied".
Example:
This is because in leo_gateway_s3_api:auth(), when preparing SignParams, uri obtained from cowboy_req:path(Req) (RawUri) is used (i.e. /test for the example above), but in leo_s3_auth module this uri is processed by remove_dup_bucket to remove /${Bucket}/ pattern. As a result uri becomes just / and the request fails.
Below is my approach to solve this problem: use Path instead of RawUri, which comes from gen_key()->leo_http:key(), i.e. always contains bucket name (test/test for the case above):
The text was updated successfully, but these errors were encountered: