{"action":"created","issue":{"url":"https://api.github.com/repos/ring-clojure/ring-codec/issues/7","labels_url":"https://api.github.com/repos/ring-clojure/ring-codec/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/ring-clojure/ring-codec/issues/7/comments","events_url":"https://api.github.com/repos/ring-clojure/ring-codec/issues/7/events","html_url":"https://github.com/ring-clojure/ring-codec/issues/7","id":60798250,"number":7,"title":"NumberFormatException from ring.util.codec/percent-decode","user":{"login":"liwp","id":44564,"avatar_url":"https://avatars.githubusercontent.com/u/44564?v=3","gravatar_id":"","url":"https://api.github.com/users/liwp","html_url":"https://github.com/liwp","followers_url":"https://api.github.com/users/liwp/followers","following_url":"https://api.github.com/users/liwp/following{/other_user}","gists_url":"https://api.github.com/users/liwp/gists{/gist_id}","starred_url":"https://api.github.com/users/liwp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liwp/subscriptions","organizations_url":"https://api.github.com/users/liwp/orgs","repos_url":"https://api.github.com/users/liwp/repos","events_url":"https://api.github.com/users/liwp/events{/privacy}","received_events_url":"https://api.github.com/users/liwp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-12T10:28:18Z","updated_at":"2015-03-12T10:31:59Z","closed_at":null,"body":"Accessing URLs like\r\n\r\n- http://example.com/%s/\r\n- http://example.com/foo%sbar\r\n- http://example.com/%XX\r\n\r\nresults in a `NumberFormatException`. This means that our app returns a `500` rather than the expected `404`.\r\n\r\nLooks like the regex `#\"%..\"` [here](https://github.com/ring-clojure/ring-codec/blob/master/src/ring/util/codec.clj#L39-L43) should only match hex digits (`#\"[0-9A-Fa-f]{2}\"`), possibly.\r\n\r\nThe [spec](http://tools.ietf.org/html/rfc3986#section-2.4) (last paragraph of 2.4) seems to say that URLs like the ones above are not valid, because the `%` should be encoded as `%25` when it's not being used for percent-encoding.\r\n\r\nSo maybe the correct fix is to `catch` the exception and return a Client Error (e.g. `400 - Bad Request`)?"},"comment":{"url":"https://api.github.com/repos/ring-clojure/ring-codec/issues/comments/78456016","html_url":"https://github.com/ring-clojure/ring-codec/issues/7#issuecomment-78456016","issue_url":"https://api.github.com/repos/ring-clojure/ring-codec/issues/7","id":78456016,"user":{"login":"jcf","id":18374,"avatar_url":"https://avatars.githubusercontent.com/u/18374?v=3","gravatar_id":"","url":"https://api.github.com/users/jcf","html_url":"https://github.com/jcf","followers_url":"https://api.github.com/users/jcf/followers","following_url":"https://api.github.com/users/jcf/following{/other_user}","gists_url":"https://api.github.com/users/jcf/gists{/gist_id}","starred_url":"https://api.github.com/users/jcf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcf/subscriptions","organizations_url":"https://api.github.com/users/jcf/orgs","repos_url":"https://api.github.com/users/jcf/repos","events_url":"https://api.github.com/users/jcf/events{/privacy}","received_events_url":"https://api.github.com/users/jcf/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T10:31:59Z","updated_at":"2015-03-12T10:31:59Z","body":"I'm creating a PR now."}}