Permalink
Browse files

current unfiltered

  • Loading branch information...
1 parent fc1eae0 commit 101919690a5da293d87942ee74b9a5fc5a96ec54 @n8han committed Jul 6, 2010
Showing with 7 additions and 6 deletions.
  1. +1 −1 project/build/SlingProject.scala
  2. +6 −5 src/main/scala/sling/App.scala
@@ -18,7 +18,7 @@ class SlingProject(info: ProjectInfo) extends DefaultProject(info) with Assembly
val dispatch_version = "0.7.3"
val dispatch_couch = "net.databinder" %% "dispatch-couch" % dispatch_version
val dispatch_twitter = "net.databinder" %% "dispatch-twitter" % dispatch_version
- val unfiltered = "net.databinder" %% "unfiltered-ajp-server" % "0.1.0"
+ val unfiltered = "net.databinder" %% "unfiltered-ajp-server" % "0.1.3-SNAPSHOT"
val rhino = "rhino" % "js" % "1.7R1"
val configgy = "net.lag" % "configgy" % "1.3" intransitive()
@@ -83,12 +83,11 @@ object App {
def etag(combo_tag: String) = CacheControl("max-age=600") ~> ETag(combo_tag)
}
-class App extends unfiltered.Plan({
+class App extends unfiltered.Planify({
case Path(DbId(db, id), req) =>
- val IfNoneMatch = "If-None-Match"
val ETag = "ETag"
- val (couch_et, tweed, tweed_js) =
- req.getHeader(IfNoneMatch) match {
+ val (couch_et, tweed, tweed_js) = req match {
+ case IfNoneMatch(header, _) => header match {
case ET(SpliceTag(couch_et, tweed, latest)) =>
val res = App.http(Search(tweed))
res.firstOption.filter { case Search.id(id) => id == latest } map { js =>
@@ -98,7 +97,9 @@ class App extends unfiltered.Plan({
(Some(couch_et), None, None)
case _ => (None, None, None)
}
- val with_heds = couch_et map { tag => /\ <:< Map(IfNoneMatch -> ET(tag)) } getOrElse /\
+ case _ => (None, None, None)
+ }
+ val with_heds = couch_et map { tag => /\ <:< Map(IfNoneMatch.name -> ET(tag)) } getOrElse /\
(App.http x with_heds <& Doc(db, id)) {
case (200, ri, Some(entity)) =>
val ET(couch_et) = ri.getFirstHeader(ETag).getValue

0 comments on commit 1019196

Please sign in to comment.