From ccd38fd5162067736125c31c73313514d09bb6e1 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 24 Jan 2020 00:03:34 +0100 Subject: [PATCH] Formatting --- .../play/it/http/parsingdeferred/Attrs.java | 4 ++++ .../SimpleActionAnnotation.java | 4 ++++ .../DeferredBodyParsingSpec.scala | 4 ++++ .../src/main/scala/play/api/mvc/Action.scala | 24 +++++++++---------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/Attrs.java b/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/Attrs.java index 3bc5ba63ab1..aca40d54c9c 100644 --- a/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/Attrs.java +++ b/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/Attrs.java @@ -1,3 +1,7 @@ +/* + * Copyright (C) Lightbend Inc. + */ + package play.it.http.parsingdeferred; import play.libs.typedmap.TypedKey; diff --git a/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/SimpleActionAnnotation.java b/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/SimpleActionAnnotation.java index 55a528652a9..dced81a33f8 100644 --- a/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/SimpleActionAnnotation.java +++ b/core/play-integration-test/src/it/java/play/it/http/parsingdeferred/SimpleActionAnnotation.java @@ -1,3 +1,7 @@ +/* + * Copyright (C) Lightbend Inc. + */ + package play.it.http.parsingdeferred; import play.mvc.Action; diff --git a/core/play-integration-test/src/it/scala/play/it/http/parsingdeferred/DeferredBodyParsingSpec.scala b/core/play-integration-test/src/it/scala/play/it/http/parsingdeferred/DeferredBodyParsingSpec.scala index 43f687dc9c2..ed8fc3fd247 100644 --- a/core/play-integration-test/src/it/scala/play/it/http/parsingdeferred/DeferredBodyParsingSpec.scala +++ b/core/play-integration-test/src/it/scala/play/it/http/parsingdeferred/DeferredBodyParsingSpec.scala @@ -1,3 +1,7 @@ +/* + * Copyright (C) Lightbend Inc. + */ + package play.it.http.parsingdeferred import java.util.concurrent.CompletableFuture diff --git a/core/play/src/main/scala/play/api/mvc/Action.scala b/core/play/src/main/scala/play/api/mvc/Action.scala index 5445751bdf1..20abafc3611 100644 --- a/core/play/src/main/scala/play/api/mvc/Action.scala +++ b/core/play/src/main/scala/play/api/mvc/Action.scala @@ -225,19 +225,17 @@ object BodyParser { ): Future[Result] = { request.attrs .get(RequestAttrKey.DeferredBodyParserInvoker) - .map( - invokeAction => { - logger.trace("Body parsing was deferred, eventually parsing now for request: " + request) - invokeAction( - // First runs the parser, then invokes the given "next" action - // (We remove the request attribute in case calling this method multiple times it won't parse again) - Future( - runParserThenInvokeAction(parser, request.removeAttr(RequestAttrKey.DeferredBodyParserInvoker), next) - ), - false - ) - } - ) + .map(invokeAction => { + logger.trace("Body parsing was deferred, eventually parsing now for request: " + request) + invokeAction( + // First runs the parser, then invokes the given "next" action + // (We remove the request attribute in case calling this method multiple times it won't parse again) + Future( + runParserThenInvokeAction(parser, request.removeAttr(RequestAttrKey.DeferredBodyParserInvoker), next) + ), + false + ) + }) .getOrElse({ logger.trace("Not parsing body, was parsed before already for request: " + request) next(request)