class DefaultCSPReportBodyParser extends CSPReportBodyParser
- Source
- CSPReportActionBuilder.scala
- Alphabetic
- By Inheritance
- DefaultCSPReportBodyParser
- CSPReportBodyParser
- BodyParser
- BodyParser
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new DefaultCSPReportBodyParser(parsers: PlayBodyParsers)(implicit ec: ExecutionContext)
- Annotations
- @Inject()
Value Members
- def andThen[A](g: (Accumulator[ByteString, Either[, ScalaCSPReport]]) => A): (RequestHeader) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def apply(rh: RequestHeader): Accumulator[ByteString, Either[, ScalaCSPReport]]
- Definition Classes
- DefaultCSPReportBodyParser → Function1
- def apply(request: RequestHeader): Accumulator[ByteString, Either[Result, JavaCSPReport]]
- Definition Classes
- DefaultCSPReportBodyParser → BodyParser
- def compose[A](g: (A) => RequestHeader): (A) => Accumulator[ByteString, Either[, ScalaCSPReport]]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def map[B](f: (ScalaCSPReport) => B)(implicit ec: ExecutionContext): BodyParser[B]
Uses the provided function to transform the BodyParser's computed result when the request body has been parsed.
Uses the provided function to transform the BodyParser's computed result when the request body has been parsed.
- f
a function for transforming the computed result
- ec
The context to execute the supplied function with. The context is prepared on the calling thread.
- returns
the transformed body parser
- Definition Classes
- BodyParser
- See also
play.api.libs.streams.Accumulator.map
- def mapM[B](f: (ScalaCSPReport) => Future[B])(implicit ec: ExecutionContext): BodyParser[B]
Like map but allows the map function to execute asynchronously.
Like map but allows the map function to execute asynchronously.
- f
the async function to map the result of the body parser
- ec
The context to execute the supplied function with. The context prepared on the calling thread.
- returns
the transformed body parser
- Definition Classes
- BodyParser
- See also
play.api.libs.streams.Accumulator.mapFuture[B]
- def toString(): String
- Definition Classes
- Function1 → AnyRef → Any
- def validate[B](f: (ScalaCSPReport) => Either[Result, B])(implicit ec: ExecutionContext): BodyParser[B]
Uses the provided function to validate the BodyParser's computed result when the request body has been parsed.
Uses the provided function to validate the BodyParser's computed result when the request body has been parsed.
The provided function can produce either a direct result, which will short circuit any further Action, or a value of type B.
Example:
def validateJson[A : Reads] = parse.json.validate( _.validate[A].asEither.left.map(e => BadRequest(JsError.toJson(e))) )
- f
the function to validate the computed result of this body parser
- ec
The context to execute the supplied function with. The context is prepared on the calling thread.
- returns
the transformed body parser
- Definition Classes
- BodyParser
- def validateM[B](f: (ScalaCSPReport) => Future[Either[Result, B]])(implicit ec: ExecutionContext): BodyParser[B]
Like validate but allows the validate function to execute asynchronously.
Like validate but allows the validate function to execute asynchronously.
- f
the async function to validate the computed result of this body parser
- ec
The context to execute the supplied function with. The context is prepared on the calling thread.
- returns
the transformed body parser
- Definition Classes
- BodyParser
- See also