Skip to content

Commit

Permalink
deploy: 3338669
Browse files Browse the repository at this point in the history
  • Loading branch information
jodersky committed Nov 2, 2024
1 parent 880d524 commit 7eb5e1d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -586,19 +586,19 @@
}
class loggedIn extends cask.RawDecorator {
def wrapFunction(ctx: cask.Request, delegate: Delegate) = {
delegate(ctx, Map("user" -> new User()))
delegate(Map("user" -> new User()))
}
}
class withExtra extends cask.RawDecorator {
def wrapFunction(ctx: cask.Request, delegate: Delegate) = {
delegate(ctx, Map("extra" -> 31337))
delegate(Map("extra" -> 31337))
}
}

class withCustomHeader extends cask.RawDecorator {
def wrapFunction(request: cask.Request, delegate: Delegate) = {
request.headers.get("x-custom-header").map(_.head) match {
case Some(header) => delegate(request, Map("customHeader" -> header))
case Some(header) => delegate(Map("customHeader" -> header))
case None =>
cask.router.Result.Success(
cask.model.Response(
Expand Down Expand Up @@ -679,12 +679,12 @@
}
class loggedIn extends cask.RawDecorator {
def wrapFunction(ctx: cask.Request, delegate: Delegate) = {
delegate(ctx, Map("user" -> new User()))
delegate(Map("user" -> new User()))
}
}
class withExtra extends cask.RawDecorator {
def wrapFunction(ctx: cask.Request, delegate: Delegate) = {
delegate(ctx, Map("extra" -> 31337))
delegate(Map("extra" -> 31337))
}
}

Expand Down Expand Up @@ -720,7 +720,7 @@
class custom(val path: String, val methods: Seq[String])
extends cask.HttpEndpoint[Int, Seq[String]]{
def wrapFunction(ctx: cask.Request, delegate: Delegate) = {
delegate(ctx, Map()).map{num =>
delegate(Map()).map{num =>
cask.Response("Echo " + num, statusCode = num)
}
}
Expand Down Expand Up @@ -970,7 +970,7 @@
class transactional extends cask.RawDecorator{
def wrapFunction(pctx: cask.Request, delegate: Delegate) = {
sqliteClient.transaction { txn =>
val res = delegate(ctx, Map("txn" -> txn))
val res = delegate(Map("txn" -> txn))
if (res.isInstanceOf[cask.router.Result.Error]) txn.rollback()
res
}
Expand Down Expand Up @@ -1064,7 +1064,7 @@
class transactional extends cask.RawDecorator{
def wrapFunction(pctx: cask.Request, delegate: Delegate) = {
sqliteClient.transaction { txn =>
val res = delegate(ctx, Map("txn" -> txn))
val res = delegate(Map("txn" -> txn))
if (res.isInstanceOf[cask.router.Result.Error]) txn.rollback()
res
}
Expand Down

0 comments on commit 7eb5e1d

Please sign in to comment.