johannesboyne / gofakes3

A simple fake AWS S3 object storage (used for local test-runs against AWS S3 APIs)
MIT License
361 stars 84 forks source link

unescape 'X-Amz-Copy-Source' value before using #53

Closed ilkinulas closed 3 years ago

ilkinulas commented 3 years ago

According to aws docs x-amz-copy-source value must be URL encoded. If source key has special chars, the client should url encode the CopySource field of s3.CopyObjectInput. If source key is not decoded, successive calls to GetObject with the same key results in 404 Not Found errors.

Here is a little background about this PR:

s5cmd integration tests use gofakes3. There is an issue about special chars which will be resolved with this PR : https://github.com/peak/s5cmd/pull/280. The implementation in this PR works fine with real s3 service but tests that use gofakes3 fails with 404 errors.

codecov-io commented 3 years ago

Codecov Report

Merging #53 (71c0e12) into master (02ffa76) will decrease coverage by 0.04%. The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   65.00%   64.96%   -0.05%     
==========================================
  Files          28       28              
  Lines        2209     2212       +3     
==========================================
+ Hits         1436     1437       +1     
- Misses        538      539       +1     
- Partials      235      236       +1     
Impacted Files Coverage Δ
gofakes3.go 64.11% <33.33%> (-0.19%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 02ffa76...71c0e12. Read the comment docs.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

johannesboyne commented 3 years ago

Hi @ilkinulas thanks a lot for the contribution! Looks good to go!