Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

RestHelper: prefix breaks extension processing #943

Closed
tackley opened this Issue · 1 comment

3 participants

@tackley

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_rest] (master)$ curl http://localhost:8080/simple5/item.json

 Exception occured while processing
/simple5/item.json
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.

@dpp dpp was assigned
@etorreborre etorreborre referenced this issue from a commit in etorreborre/framework
@dpp dpp fixes #943. Better list manipulation 550feb0
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.