Commit 49c25e75 authored by Jeffrey I. Schiller's avatar Jeffrey I. Schiller Committed by Evan W. Patton

Fix a 500 Error

Google Search reported this to us. If you go to “/b” you get an
ArrayIndexOutOfBounds exception. This is not a valid URL, normally in
practice a code follows the /b/ which points to the APK to download. So
given that /b is not valid, we turn the error into a 404, which makes
more sense.

Change-Id: Id3ac26a35eb2cb51038a74974850ee401b9fb91c
parent 308f1f33
......@@ -65,6 +65,10 @@ public class BuildOutputServlet extends OdeServlet {
String uri = req.getRequestURI();
// First, call split with no limit parameter.
String[] uriComponents = uri.split("/");
if (uriComponents.length < 3) {
resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return;
}
nonceValue = uriComponents[2];
storageIo.cleanupNonces(); // This removes expired Nonce objects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment