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

URLEncoding fails #18

Open
dtitov opened this issue Nov 8, 2019 · 0 comments
Open

URLEncoding fails #18

dtitov opened this issue Nov 8, 2019 · 0 comments

Comments

@dtitov
Copy link

dtitov commented Nov 8, 2019

Hi,

I think I spotted a bug, but I'm a bit unsure. When I tried to connect with different clients, the signature verification failed. I started to wonder why and noticed that the URL to sign looked like this:

mc: <DEBUG> GET /bucketName/?delimiter=%2F&max-keys=1000&prefix= HTTP/1.1

As you can see, the delimiter is already URL-encoded here (originally it's just a slash). But then on the backend in your library you are encoding it again:

            builder.append(URLEncoding.encodeQueryComponent(name))
                    .append(QUERY_PARAMETER_VALUE_SEPARATOR)
                    .append(URLEncoding.encodeQueryComponent(value));

Which turns %2F to %225F or smth like that. And, obviously, validation fails.

If I just skip the encoding part in your lib, then it works.

I noticed that you have a reference to docs about URL escaping:

        /*
         * See http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
         * for the list of characters that should not be escaped
         */

But if you go to this link, there's nothing mentioned there about the necessity to encode URL parts.

Is it possible that the protocol was changed a bit since you've implemented it? And is it possible to make the URL-encoding optional in your lib?

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

1 participant