mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(resourceexplorer2): reject invalid pagination tokens (#3444)
This commit is contained in:
1 parent
128d3ef181
commit
f482a2d15e
3 files changed
+30
-6
No files matched your search
+7
-3
@@ -999,10 +999,14 @@ public class ResourceExplorer2Service {
|
||||
return 0;
|
||||
}
|
||||
try {
|
||||
return Integer.parseInt(new String(Base64.getDecoder().decode(token)));
|
||||
int offset = Integer.parseInt(new String(Base64.getDecoder().decode(token)));
|
||||
if (offset < 0) {
|
||||
throw new IllegalArgumentException("negative offset");
|
||||
}
|
||||
return offset;
|
||||
} catch (Exception e) {
|
||||
LOG.debugf("Invalid NextToken '%s', restarting from offset 0: %s", token, e.getMessage());
|
||||
return 0;
|
||||
throw new AwsException("ValidationException",
|
||||
"NextToken is invalid or has expired.", 400);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user