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

blob/s3blob: Stop escaping second / in //; it's no longer necessary #3251

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 1 addition & 5 deletions blob/s3blob/s3blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
// full UTF-8 support, strings must be escaped (during writes) and unescaped
// (during reads). The following escapes are performed for s3blob:
// - Blob keys: ASCII characters 0-31 are escaped to "__0x<hex>__".
// Additionally, the "/" in "../" and the trailing "/" in "//" are escaped in
// the same way.
// Additionally, the "/" in "../" is escaped in the same way.
// - Metadata keys: Escaped using URL encoding, then additionally "@:=" are
// escaped using "__0x<hex>__". These characters were determined by
// experimentation.
Expand Down Expand Up @@ -902,9 +901,6 @@ func escapeKey(key string) string {
// For "../", escape the trailing slash.
case i > 1 && c == '/' && r[i-1] == '.' && r[i-2] == '.':
return true
// For "//", escape the trailing slash. Otherwise, S3 drops it.
case i > 0 && c == '/' && r[i-1] == '/':
return true
}
return false
})
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading