{"action":"created","issue":{"url":"https://api.github.com/repos/tumblr/colossus/issues/209","labels_url":"https://api.github.com/repos/tumblr/colossus/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/tumblr/colossus/issues/209/comments","events_url":"https://api.github.com/repos/tumblr/colossus/issues/209/events","html_url":"https://github.com/tumblr/colossus/issues/209","id":86723673,"number":209,"title":"Query String parameters without values causes ArrayIndexOutOfBoundsException","user":{"login":"newfurniturey","id":3894981,"avatar_url":"https://avatars.githubusercontent.com/u/3894981?v=3","gravatar_id":"","url":"https://api.github.com/users/newfurniturey","html_url":"https://github.com/newfurniturey","followers_url":"https://api.github.com/users/newfurniturey/followers","following_url":"https://api.github.com/users/newfurniturey/following{/other_user}","gists_url":"https://api.github.com/users/newfurniturey/gists{/gist_id}","starred_url":"https://api.github.com/users/newfurniturey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newfurniturey/subscriptions","organizations_url":"https://api.github.com/users/newfurniturey/orgs","repos_url":"https://api.github.com/users/newfurniturey/repos","events_url":"https://api.github.com/users/newfurniturey/events{/privacy}","received_events_url":"https://api.github.com/users/newfurniturey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-09T20:19:52Z","updated_at":"2015-06-09T20:28:19Z","closed_at":null,"body":"If you're running an HTTP service w/ colossus and hit the service via a URL that contains query string parameters that have no values set, such as:\r\n\r\n    http://www.example.com/page?debug\r\n\r\nan `ArrayIndexOutOfBoundsException` is thrown:\r\n\r\n> java.lang.ArrayIndexOutOfBoundsException: 1\r\n>   at colossus.protocols.http.HttpHead$$anonfun$parseParameters$1.apply(Header.scala:212)\r\n>   at colossus.protocols.http.HttpHead$$anonfun$parseParameters$1.apply(Header.scala:210)\r\n>   at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)\r\n>   at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)\r\n>   at colossus.protocols.http.HttpHead$.parseParameters(Header.scala:210)[WARN] [06/09/2015 16:12:19.822] [COLOSSUS-server-dispatcher-10] [akka://COLOSSUS/user/devprog-manager/worker-4] Unknown Error! : java.lang.ArrayIndexOutOfBoundsException: 1\r\n>   at colossus.protocols.http.HttpHead.<init>(Header.scala:163)\r\n>   at colossus.protocols.http.HttpRequestParser$$anonfun$httpHead$1.apply(HttpRequestParser.scala:29)\r\n>   at colossus.protocols.http.HttpRequestParser$$anonfun$httpHead$1.apply(HttpRequestParser.scala:28)\r\n>   at colossus.parsing.Combinators$Parser$$anon$3$$anonfun$parse$2.apply(Parsing.scala:230)\r\n>   at scala.Option.map(Option.scala:146)\r\n>   at colossus.parsing.Combinators$Parser$$anon$3.parse(Parsing.scala:230)\r\n>   at colossus.parsing.Combinators$Parser$$anon$4.parse(Parsing.scala:244)\r\n>   at colossus.parsing.Combinators$$anon$7$$anonfun$parse$6.apply(Parsing.scala:295)\r\n>   at colossus.parsing.Combinators$$anon$7$$anonfun$parse$6.apply(Parsing.scala:295)\r\n>   at colossus.parsing.ParserSizeTracker.track(Parsing.scala:57)\r\n>   at colossus.parsing.Combinators$$anon$7.parse(Parsing.scala:295)\r\n>   at colossus.protocols.http.BaseHttpServerCodec.decode(HttpServerCodec.scala:17)\r\n>   at colossus.controller.InputController$class.receivedData(InputController.scala:122)\r\n>   at colossus.controller.Controller.receivedData(Controller.scala:87)\r\n>   at colossus.core.Connection.handleRead(Connection.scala:197)\r\n>   at colossus.core.Worker.selectLoop(Worker.scala:441)\r\n>   at colossus.core.Worker$$anonfun$accepting$1.applyOrElse(Worker.scala:178)\r\n>   at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)\r\n>   at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)\r\n>   at akka.actor.Actor$class.aroundReceive(Actor.scala:465)\r\n>   at colossus.core.Worker.aroundReceive(Worker.scala:120)\r\n>   at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)\r\n>   at akka.actor.ActorCell.invoke(ActorCell.scala:487)\r\n>   at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)\r\n>   at akka.dispatch.Mailbox.run(Mailbox.scala:221)\r\n>   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\r\n>   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\r\n>   at java.lang.Thread.run(Thread.java:722)\r\n\r\nSample codeblock to reproduce:\r\n\r\n    Service.serve[Http](\"dev-prog\", config.servicePort) { context =>\r\n        context.handle { connection =>\r\n            connection.become {\r\n                case req @ Get on Root => req.ok(s\"Hi, from: ${req.head.url}\")\r\n            }\r\n        }\r\n    }"},"comment":{"url":"https://api.github.com/repos/tumblr/colossus/issues/comments/110495188","html_url":"https://github.com/tumblr/colossus/issues/209#issuecomment-110495188","issue_url":"https://api.github.com/repos/tumblr/colossus/issues/209","id":110495188,"user":{"login":"DanSimon","id":287961,"avatar_url":"https://avatars.githubusercontent.com/u/287961?v=3","gravatar_id":"","url":"https://api.github.com/users/DanSimon","html_url":"https://github.com/DanSimon","followers_url":"https://api.github.com/users/DanSimon/followers","following_url":"https://api.github.com/users/DanSimon/following{/other_user}","gists_url":"https://api.github.com/users/DanSimon/gists{/gist_id}","starred_url":"https://api.github.com/users/DanSimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanSimon/subscriptions","organizations_url":"https://api.github.com/users/DanSimon/orgs","repos_url":"https://api.github.com/users/DanSimon/repos","events_url":"https://api.github.com/users/DanSimon/events{/privacy}","received_events_url":"https://api.github.com/users/DanSimon/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T20:28:19Z","updated_at":"2015-06-09T20:28:19Z","body":"Which version of Colossus are you on?  #206 , which is in 0.6.3, should have fixed this."}}