projects
/
pithos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
892b214
)
Return HTTP status 400 instead of 500, when the path cannot be properly decoded.
author
pastith
<devnull@localhost>
Thu, 2 Apr 2009 09:38:35 +0000
(09:38 +0000)
committer
pastith
<devnull@localhost>
Thu, 2 Apr 2009 09:38:35 +0000
(09:38 +0000)
gss/src/gr/ebs/gss/server/rest/FilesHandler.java
patch
|
blob
|
history
diff --git
a/gss/src/gr/ebs/gss/server/rest/FilesHandler.java
b/gss/src/gr/ebs/gss/server/rest/FilesHandler.java
index
0412c53
..
825b9e2
100644
(file)
--- a/
gss/src/gr/ebs/gss/server/rest/FilesHandler.java
+++ b/
gss/src/gr/ebs/gss/server/rest/FilesHandler.java
@@
-576,7
+576,12
@@
public class FilesHandler extends RequestHandler {
}
String path = getInnerPath(req, PATH_FILES);
path = path.endsWith("/")? path: path + '/';
- path = URLDecoder.decode(path, "UTF-8");
+ try {
+ path = URLDecoder.decode(path, "UTF-8");
+ } catch (IllegalArgumentException e) {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
+ return;
+ }
// We only defer authenticating multipart POST requests.
if (authDeferred) {
if (!ServletFileUpload.isMultipartContent(req)) {