mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix: return 400 when encoded s3 copy source is malformed (#244)
fix: replace silent exception swallowing and add per-test timeout in Python test suite test: misc compatibility-tests cleanups - Added sync comments to both main.tf files - Created compatibility-tests/.dockerignore - Cached CRC32 table in Node setup.ts - Removed >/dev/null 2>&1 from 3 Dockerfiles test: add missing .terraform.lock.hcl chore: remove .terraform.lock.hcl
This commit is contained in:
1 parent
d02a1d9a13
commit
f4f1752b0d
17 files changed
+84
-51
No files matched your search
@@ -1263,9 +1263,14 @@ public class S3Controller {
|
||||
String source = copySource.startsWith("/") ? copySource.substring(1) : copySource;
|
||||
|
||||
// URL decode the entire source first, then split
|
||||
String decodedSource = URLDecoder.decode(source, StandardCharsets.UTF_8);
|
||||
String decodedSource;
|
||||
try {
|
||||
decodedSource = URLDecoder.decode(source, StandardCharsets.UTF_8);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new AwsException("InvalidArgument", "Invalid copy source: " + copySource, 400);
|
||||
}
|
||||
int slashIndex = decodedSource.indexOf('/');
|
||||
if (slashIndex < 0) {
|
||||
if (slashIndex <= 0) {
|
||||
throw new AwsException("InvalidArgument", "Invalid copy source: " + copySource, 400);
|
||||
}
|
||||
String sourceBucket = decodedSource.substring(0, slashIndex);
|
||||
@@ -1294,9 +1299,14 @@ public class S3Controller {
|
||||
String source = copySource.startsWith("/") ? copySource.substring(1) : copySource;
|
||||
|
||||
// URL decode the entire source first, then split.
|
||||
String decodedSource = URLDecoder.decode(source, StandardCharsets.UTF_8);
|
||||
String decodedSource;
|
||||
try {
|
||||
decodedSource = URLDecoder.decode(source, StandardCharsets.UTF_8);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new AwsException("InvalidArgument", "Invalid copy source: " + copySource, 400);
|
||||
}
|
||||
int slashIndex = decodedSource.indexOf('/');
|
||||
if (slashIndex < 0) {
|
||||
if (slashIndex <= 0) {
|
||||
throw new AwsException("InvalidArgument", "Invalid copy source: " + copySource, 400);
|
||||
}
|
||||
String sourceBucket = decodedSource.substring(0, slashIndex);
|
||||
|
||||
Reference in new issue
Block a user