{"action":"opened","issue":{"url":"https://api.github.com/repos/Polyjuice/Polyjuice/issues/41","labels_url":"https://api.github.com/repos/Polyjuice/Polyjuice/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/Polyjuice/Polyjuice/issues/41/comments","events_url":"https://api.github.com/repos/Polyjuice/Polyjuice/issues/41/events","html_url":"https://github.com/Polyjuice/Polyjuice/issues/41","id":70389706,"number":41,"title":"Stop launcher from tampering with certain requests to enable REST API","user":{"login":"mtornwall","id":1321973,"avatar_url":"https://avatars.githubusercontent.com/u/1321973?v=3","gravatar_id":"","url":"https://api.github.com/users/mtornwall","html_url":"https://github.com/mtornwall","followers_url":"https://api.github.com/users/mtornwall/followers","following_url":"https://api.github.com/users/mtornwall/following{/other_user}","gists_url":"https://api.github.com/users/mtornwall/gists{/gist_id}","starred_url":"https://api.github.com/users/mtornwall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtornwall/subscriptions","organizations_url":"https://api.github.com/users/mtornwall/orgs","repos_url":"https://api.github.com/users/mtornwall/repos","events_url":"https://api.github.com/users/mtornwall/events{/privacy}","received_events_url":"https://api.github.com/users/mtornwall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-23T11:36:13Z","updated_at":"2015-04-23T11:36:13Z","closed_at":null,"body":"The way the launcher behaves right now (or rather, the way LauncherHelper behaves) makes it difficult to implement a REST API while the launcher is running. Since it installs a middleware filter to wrap the pages it serves in the launcher the responses from the REST API get garbled.\r\n\r\nMy current (incredibly ugly) work-around involves wrapping the middleware filter installed by LauncherHelper in another filter that first checks to see if the URL matches my REST API prefix, and if so aborts processing. If not, it proceeds with the launcher's middleware filter as usual:\r\n\r\n    var oldHandler = Handle.middlewareFilters_[0].FilterRequest;\r\n    Handle.middlewareFilters_[0].FilterRequest = (r) =>\r\n    {\r\n         if (r.Uri.StartsWith(\"/myapp/rest/resources\", StringComparison.InvariantCultureIgnoreCase))\r\n            return null;\r\n        return oldHandler(r);\r\n    };\r\n\r\nClearly this solution is not ideal. I would like to be able to register URL patterns or prefixes to be excluded from launcher wrapping."}}