{"action":"closed","issue":{"url":"https://api.github.com/repos/opendatakit/collect/issues/175","repository_url":"https://api.github.com/repos/opendatakit/collect","labels_url":"https://api.github.com/repos/opendatakit/collect/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/opendatakit/collect/issues/175/comments","events_url":"https://api.github.com/repos/opendatakit/collect/issues/175/events","html_url":"https://github.com/opendatakit/collect/issues/175","id":175114217,"number":175,"title":"WebUtils.createOpenRosaHttpHead can throw uncaught IllegalArgumentException","user":{"login":"opendatakit-bot","id":22008766,"avatar_url":"https://avatars.githubusercontent.com/u/22008766?v=3","gravatar_id":"","url":"https://api.github.com/users/opendatakit-bot","html_url":"https://github.com/opendatakit-bot","followers_url":"https://api.github.com/users/opendatakit-bot/followers","following_url":"https://api.github.com/users/opendatakit-bot/following{/other_user}","gists_url":"https://api.github.com/users/opendatakit-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/opendatakit-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opendatakit-bot/subscriptions","organizations_url":"https://api.github.com/users/opendatakit-bot/orgs","repos_url":"https://api.github.com/users/opendatakit-bot/repos","events_url":"https://api.github.com/users/opendatakit-bot/events{/privacy}","received_events_url":"https://api.github.com/users/opendatakit-bot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opendatakit/collect/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/opendatakit/collect/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/opendatakit/collect/labels/Priority-Medium","name":"Priority-Medium","color":"fef2c0"}],"state":"closed","locked":false,"assignee":{"login":"mitchellsundt","id":2281171,"avatar_url":"https://avatars.githubusercontent.com/u/2281171?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellsundt","html_url":"https://github.com/mitchellsundt","followers_url":"https://api.github.com/users/mitchellsundt/followers","following_url":"https://api.github.com/users/mitchellsundt/following{/other_user}","gists_url":"https://api.github.com/users/mitchellsundt/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellsundt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellsundt/subscriptions","organizations_url":"https://api.github.com/users/mitchellsundt/orgs","repos_url":"https://api.github.com/users/mitchellsundt/repos","events_url":"https://api.github.com/users/mitchellsundt/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellsundt/received_events","type":"User","site_admin":false},"assignees":[{"login":"mitchellsundt","id":2281171,"avatar_url":"https://avatars.githubusercontent.com/u/2281171?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellsundt","html_url":"https://github.com/mitchellsundt","followers_url":"https://api.github.com/users/mitchellsundt/followers","following_url":"https://api.github.com/users/mitchellsundt/following{/other_user}","gists_url":"https://api.github.com/users/mitchellsundt/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellsundt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellsundt/subscriptions","organizations_url":"https://api.github.com/users/mitchellsundt/orgs","repos_url":"https://api.github.com/users/mitchellsundt/repos","events_url":"https://api.github.com/users/mitchellsundt/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellsundt/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-09-05T18:26:29Z","updated_at":"2016-10-26T08:12:17Z","closed_at":"2016-10-26T08:12:17Z","body":"<a href=\"https://github.com/mitchellsundt\"><img src=\"https://avatars.githubusercontent.com/u/2281171?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [mitchellsundt](https://github.com/mitchellsundt)**\n_Thursday Jul 09, 2015 at 19:46 GMT_\n_Originally opened as https://github.com/opendatakit/opendatakit/issues/1147 (0 comment(s))_\n\n----\n\nOriginally reported on Google Code with ID 1146\n```\nWhat steps will reproduce the problem?\n1. Enter an ODK Collect URL with a leading space (e.g. \" https://foobar.com\")\r\n2. Attempt to submit a form\r\n\r\nWhat is the expected output? What do you see instead?\nExpected outcome: ODK Collect should indicate that the URL is invalid\r\nActual outcome: ODK Collect crashes\r\n\r\nPlease provide any additional information below.\nWebUtils.createOpenRosaHttpHead uses java.net.URI.create without catching the thrown\nIllegalArgumentException.  This only manifests itself when forms are uploaded.  This\nbit us during a training exercise when half our users were unable to upload forms from\nthe field with ODK crashing when they tried.  When I got the devices back, I found\nthis in the logfile:\r\nE/AndroidRuntime(16668): Caused by: java.lang.IllegalArgumentException: Illegal character\nin scheme at index 0:  https://<URI removed>\r\nE/AndroidRuntime(16668): \tat java.net.URI.create(URI.java:733)\r\nE/AndroidRuntime(16668): \tat org.odk.collect.android.utilities.WebUtils.createOpenRosaHttpHead(WebUtils.java:204)\r\netc\r\n\r\nFix is simple:\r\n1) trim() the URI string before attempting to create a URI, to make this more robust\r\n2) Delcare that the method throws IllegalArgumentException, and catch it in InstanceUplaoderTask.uploadOneSubmission,\nalong with the other exceptions that are caught and logged properly there.\r\n\r\n\n```\n\nReported by `inverarity` on 2015-05-26 10:01:32\n\n"}}
{"actor":{"display_login":"yanokwa"}}