{"action":"opened","issue":{"url":"https://api.github.com/repos/smartrics/RestFixture/issues/112","labels_url":"https://api.github.com/repos/smartrics/RestFixture/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/smartrics/RestFixture/issues/112/comments","events_url":"https://api.github.com/repos/smartrics/RestFixture/issues/112/events","html_url":"https://github.com/smartrics/RestFixture/issues/112","id":56563810,"number":112,"title":"Bad URL constucted when embedded question marks","user":{"login":"jplambert","id":10744293,"avatar_url":"https://avatars.githubusercontent.com/u/10744293?v=3","gravatar_id":"","url":"https://api.github.com/users/jplambert","html_url":"https://github.com/jplambert","followers_url":"https://api.github.com/users/jplambert/followers","following_url":"https://api.github.com/users/jplambert/following{/other_user}","gists_url":"https://api.github.com/users/jplambert/gists{/gist_id}","starred_url":"https://api.github.com/users/jplambert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jplambert/subscriptions","organizations_url":"https://api.github.com/users/jplambert/orgs","repos_url":"https://api.github.com/users/jplambert/repos","events_url":"https://api.github.com/users/jplambert/events{/privacy}","received_events_url":"https://api.github.com/users/jplambert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-04T18:01:33Z","updated_at":"2015-02-04T18:01:33Z","closed_at":null,"body":"I found out that using some convoluted URLs, RestFixture shows some very strange behaviors.\r\n\r\n| Table: Rest Fixture | http://localhost:8070 | hopconf|\r\n| GET | /abc/xyz?url=http://host/ws?g | | | |\r\n\r\n=> Will make the request go on http://localhost:8070/abc/xyz\r\n\r\nI found where is located the issue in the code, it is RestFixture#doMethod(String, String, Map<String, String>, String), the url is split by the \"?\" character, the first part being taken as the base URL and the second part as the query part. However if there is more than two parts, the remaining is left out and things go wrong...\r\n\r\nIt is very easy to fix. One can concatenate all the remaining split parts when building up the query part. Or even more simple, just add the '2' value as a second parameter of the String.split(String, int) call so that it guarantees not to create more than two chunks.\r\n\r\nI will gladly make a Pull Request as soon as I managed to use GitHub... Unless I am beaten by somebody else on this :-)\r\n\r\nNote: I *do* need this fix for the project I'm working on."}}