diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..8660957 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.8.4 +8efd8b89b006133455c8cf9d26ce963ec1aabdac diff --git a/.scalafmt.conf b/.scalafmt.conf index 465a924..45985d7 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = 3.8.3 +version = 3.8.4 align.openParenCallSite = true align.openParenDefnSite = true maxColumn = 120 diff --git a/core/src/main/scala/org/http4s/session/SessionMiddleware.scala b/core/src/main/scala/org/http4s/session/SessionMiddleware.scala index d1c26e6..75125ca 100644 --- a/core/src/main/scala/org/http4s/session/SessionMiddleware.scala +++ b/core/src/main/scala/org/http4s/session/SessionMiddleware.scala @@ -126,14 +126,15 @@ object SessionMiddleware { ) case (Some(id), None) => sessionStore - .modifySession(id, - { now => - val next: Option[A] = mergeOnChanged.fold(Option.empty[A]) { mm => - if (!mm.eqv(sessionOpt, now)) mm.whenDifferent(now, Option.empty) - else None - } - (next, ()) - } + .modifySession( + id, + { now => + val next: Option[A] = mergeOnChanged.fold(Option.empty[A]) { mm => + if (!mm.eqv(sessionOpt, now)) mm.whenDifferent(now, Option.empty) + else None + } + (next, ()) + } ) .as(response.response.putHeaders(deleteCookie)) }) @@ -198,25 +199,27 @@ object SessionMiddleware { response <- sessionApp(ContextRequest(sessionOpt.getOrElse(default), req)) out <- OptionT.liftF(sessionId match { case Some(id) => - sessionStore.modifySession(id, - { now => - val next: Option[A] = mergeOnChanged.fold(Option.empty[A]) { mm => - if (!mm.eqv(sessionOpt, now)) mm.whenDifferent(now, Option.empty) - else None - } - (next, ()) - } + sessionStore.modifySession( + id, + { now => + val next: Option[A] = mergeOnChanged.fold(Option.empty[A]) { mm => + if (!mm.eqv(sessionOpt, now)) mm.whenDifferent(now, Option.empty) + else None + } + (next, ()) + } ) >> sessionCookie(id).map(response.response.putHeaders(_)) case None => sessionStore.createSessionId.flatMap(id => - sessionStore.modifySession(id, - { now => - val next: Option[A] = mergeOnChanged.fold(Option.empty[A]) { mm => - if (!mm.eqv(sessionOpt, now)) mm.whenDifferent(now, Option.empty) - else None - } - (next, ()) - } + sessionStore.modifySession( + id, + { now => + val next: Option[A] = mergeOnChanged.fold(Option.empty[A]) { mm => + if (!mm.eqv(sessionOpt, now)) mm.whenDifferent(now, Option.empty) + else None + } + (next, ()) + } ) >> sessionCookie(id).map(response.response.putHeaders(_)) ) })