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

URL-Encoding in Path is applied twice #55

Closed
darkecho731 opened this issue Apr 4, 2023 · 0 comments · Fixed by #56
Closed

URL-Encoding in Path is applied twice #55

darkecho731 opened this issue Apr 4, 2023 · 0 comments · Fixed by #56

Comments

@darkecho731
Copy link
Contributor

Hi,

I guess I've found a bug when trying to use a path (or the mount) with whitespaces. They seem to be encoded twice.

Example:

kv2::list(&client, "some secret engine", "some path to a secret").await.unwrap();

will yield the following path: https://some-vault-url.com/v1/some%2520secret%2520engine/metadata/some%2520path%2520to%2520a%2520secret

The whitespace seems to be encoded twice. First to %20 and then the % is encoded to %25 which yields %2520. In the end this obviously leads to a 404 on the Vault.

The same behavior can be observed on kv2::read etc.

Here are the relevant logs:

[2023-04-04T20:37:37Z DEBUG rustify::endpoint] Executing endpoint
[2023-04-04T20:37:37Z DEBUG rustify::http] Building endpoint request
[2023-04-04T20:37:37Z DEBUG vaultrs::api] Middleware: prepending v1 version to URL
[2023-04-04T20:37:37Z DEBUG vaultrs::api] Middleware: final URL is https://some-vault-url.com/v1/some%2520secret%2520engine/metadata/some%2520path%2520to%2520a%2520secret
[2023-04-04T20:37:37Z DEBUG vaultrs::api] Middleware: adding token to header

thanks for your work on this library.

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

Successfully merging a pull request may close this issue.

1 participant