Skip to content

Commit

Permalink
blob/s3blob: Stop escaping second / in //; it's no longer necessary (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vangent committed May 12, 2023
1 parent 04a775a commit d11bbf6
Show file tree
Hide file tree
Showing 301 changed files with 12,702 additions and 9,370 deletions.
6 changes: 1 addition & 5 deletions blob/s3blob/s3blob.go
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 @@ -910,9 +909,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.

0 comments on commit d11bbf6

Please sign in to comment.