Handle requests with // at the beginning
[louyapi.git] / src / main / java / de / cweiske / ouya / louyapi / HttpServer.java
index 2e5779a8b1b8bd40da9a4dafbe4c84b2ea92aa27..5375784c9c96baab85b0cf480ca2ed01517bd65d 100644 (file)
@@ -28,6 +28,12 @@ public class HttpServer extends NanoHTTPD {
      */
     public Response serve(IHTTPSession session) {
         String path = session.getUri();
+        Log.d(TAG, "serve: " + path);
+        //this happens with "//agreements/marketplace.html". remove double slash.
+        if (path.startsWith("//")) {
+            path = path.substring(1);
+        }
+
         InputStream content;
 
         if (path.equals("/api/v1/status") || path.equals("/generate_204")) {