RestHelper: prefix breaks extension processing
Based on the simply lift RestHelper example https://github.com/dpp/simply_lift/blob/master/samples/http_rest/src/main/scala/code/lib/BasicWithHelper.scala, with the latest lift 2.3-SNAPSHOT:
Calling the simple5 endpoint with an extension generates an exception:
(http://localhost:8080/simple5/item works fine.)
My limited testing has shown that I get this kind of error whenever I specify an extension to an endpoint declared using the prefix helper, and is fine if you don't use it.
Calling the simple5 endpoint with an extension generates an exception:
[http_rest] (master)$ curl http://localhost:8080/simple5/item.json <!DOCTYPE html> <html> <body>Exception occured while processing /simple5/item.json<pre>Message: java.util.NoSuchElementException scala.collection.LinearSeqOptimized$class.last(LinearSeqOptimized.scala:147) scala.collection.immutable.List.last(List.scala:45) net.liftweb.http.ParsePath.wholePath(Req.scala:1178) net.liftweb.http.Req.path(Req.scala:855) net.liftweb.http.Req.<init>(Req.scala:848) net.liftweb.http.Req$$anon$1.<init>(Req.scala:747) net.liftweb.http.Req.withNewPath(Req.scala:747) net.liftweb.http.rest.ListServeMagic$$anon$14.isDefinedAt(RestHelper.scala:682) net.liftweb.http.rest.ListServeMagic$$anon$14.isDefinedAt(RestHelper.scala:679) net.liftweb.http.rest.RestHelper$$anonfun$isDefinedAt$1.apply(RestHelper.scala:467) net.liftweb.http.rest.RestHelper$$anonfun$isDefinedAt$1.apply(RestHelper.scala:467) scala.collection.LinearSeqOptimized$class.find(LinearSeqOptimized.scala:102) scala.collection.immutable.List.find(List.scala:45) net.liftweb.http.rest.RestHelper$class.isDefinedAt(RestHelper.scala:467) code.lib.BasicWithHelper$.isDefinedAt(BasicWithHelper.scala:17) code.lib.BasicWithHelper$.isDefinedAt(BasicWithHelper.scala:17) net.liftweb.util.NamedPF$$anonfun$find$1.apply(NamedPartialFunction.scala:57) net.liftweb.util.NamedPF$$anonfun$find$1.apply(NamedPartialFunction.scala:57) scala.collection.LinearSeqOptimized$class.find(LinearSeqOptimized.scala:102) scala.collection.immutable.List.find(List.scala:45) ...
(http://localhost:8080/simple5/item works fine.)
My limited testing has shown that I get this kind of error whenever I specify an extension to an endpoint declared using the prefix helper, and is fine if you don't use it.
Leave a comment