Skip to content

Conversation

mateuszkj
Copy link
Contributor

Describe the bug
URI paths from HTTP request should be urldecoded.

To Reproduce

  1. Create example data and run S3 server
mkdir -p example/data
echo "abc" >  example/data/abc=1.txt
RUST_LOG=debug s3-server --fs-root ./example/
  1. Get file by curl
$ curl -i "http://localhost:8014/data/abc%3D1.txt"
HTTP/1.1 404 Not Found
content-type: text/xml
content-length: 127
date: Sat, 09 Apr 2022 22:40:02 GMT

<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message></Error>

Expected behavior

$ curl -i "http://localhost:8014/data/abc%3D1.txt"
HTTP/1.1 200 OK
last-modified: Sat, 09 Apr 2022 22:35:00 GMT
content-length: 4
etag: "0bee89b07a248e27c83fc3d5951213c1"
date: Sat, 09 Apr 2022 22:40:45 GMT

abc

Additional context

Client https://crates.io/crates/rust-s3 urlencodes special characters, so this merge requests fixes it.

Copy link
Contributor

@Nugine Nugine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix.
There are some lines to be changed. And then we can merge this PR.

@mateuszkj
Copy link
Contributor Author

@Nugine thanks for core review. I have applied yours comments and force pushed.

@Nugine Nugine merged commit fb7f5a4 into datenlord:master Apr 24, 2022
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 this pull request may close these issues.

2 participants