Allow capitals as first character in bucket name

Curiously Amazon permits mixed case but documents that only lowercase
letters are allowed:

https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html

Fixes #226.
pull/154/merge
Andrew Gaul 2017-05-24 21:53:03 -07:00
rodzic ca96906118
commit 742820a93d
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -128,10 +128,10 @@ public class S3ProxyHandler {
private static final String FAKE_REQUEST_ID = "4442587FB7D0A2F9";
private static final CharMatcher VALID_BUCKET_FIRST_CHAR =
CharMatcher.inRange('a', 'z')
.or(CharMatcher.inRange('A', 'Z'))
.or(CharMatcher.inRange('0', '9'));
private static final CharMatcher VALID_BUCKET =
VALID_BUCKET_FIRST_CHAR
.or(CharMatcher.inRange('A', 'Z'))
.or(CharMatcher.is('.'))
.or(CharMatcher.is('_'))
.or(CharMatcher.is('-'));