diff --git a/index.html b/index.html index 16a7742967..7a3bf51ca0 100644 --- a/index.html +++ b/index.html @@ -586,19 +586,19 @@ } class loggedIn extends cask.RawDecorator { def wrapFunction(ctx: cask.Request, delegate: Delegate) = { - delegate(Map("user" -> new User())) + delegate(ctx, Map("user" -> new User())) } } class withExtra extends cask.RawDecorator { def wrapFunction(ctx: cask.Request, delegate: Delegate) = { - delegate(Map("extra" -> 31337)) + delegate(ctx, 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(Map("customHeader" -> header)) + case Some(header) => delegate(request, Map("customHeader" -> header)) case None => cask.router.Result.Success( cask.model.Response( @@ -679,12 +679,12 @@ } class loggedIn extends cask.RawDecorator { def wrapFunction(ctx: cask.Request, delegate: Delegate) = { - delegate(Map("user" -> new User())) + delegate(ctx, Map("user" -> new User())) } } class withExtra extends cask.RawDecorator { def wrapFunction(ctx: cask.Request, delegate: Delegate) = { - delegate(Map("extra" -> 31337)) + delegate(ctx, Map("extra" -> 31337)) } } @@ -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(Map()).map{num => + delegate(ctx, Map()).map{num => cask.Response("Echo " + num, statusCode = num) } } @@ -970,7 +970,7 @@ class transactional extends cask.RawDecorator{ def wrapFunction(pctx: cask.Request, delegate: Delegate) = { sqliteClient.transaction { txn => - val res = delegate(Map("txn" -> txn)) + val res = delegate(ctx, Map("txn" -> txn)) if (res.isInstanceOf[cask.router.Result.Error]) txn.rollback() res } @@ -1064,7 +1064,7 @@ class transactional extends cask.RawDecorator{ def wrapFunction(pctx: cask.Request, delegate: Delegate) = { sqliteClient.transaction { txn => - val res = delegate(Map("txn" -> txn)) + val res = delegate(ctx, Map("txn" -> txn)) if (res.isInstanceOf[cask.router.Result.Error]) txn.rollback() res }