Barista
Barista copied to clipboard
Request query is ignored
I noticed that when I attached a query to my URL, it wasn't showing up in the parameters. I tracked this down to a change in commit 4fa48b7c42de46dbab7437b0fa3e98ad20e88d32. Instead of routing on the request.URL it routes on the request.URL.path in order to avoid the problem of JLRoutes using the host in the path.
This looks like some kind of rock and hard place. If the URL is used, the query is left alone, which is good, but the host is used, which is bad. If the URL.path is used the host is stripped off, which is good, but the query is also stripped off, which is bad.
Is JLRoutes using the host 'A Good Thing'? I notice the comment in that code says it is for some kind of backward-compatibility; maybe JLRoutes should not do it at all, or have a switch to disable it or something (which I realise is a topic to take up in the JLRoutes issues).
I'm putting this here because I don't think it is working right, but I don't know what is the right solution.
For the time being, to make it work in my app (I'm using Barista as a dev helper to dish up JSON to the iPhone app I'm developing), I have simply gone back to using URL for routing, and commented out the part of JLRoutes which uses the host name for routing.