Switch back to the last Java 7 compatible http4s version

This commit is contained in:
Alexandre Archambault 2016-05-09 11:28:11 +02:00
parent 6f404764f7
commit 774a599bdd
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
2 changed files with 10 additions and 4 deletions

View File

@ -506,13 +506,15 @@ lazy val plugin = project
scriptedBufferLog := false
)
val http4sVersion = "0.8.6"
lazy val `simple-web-server` = project
.settings(commonSettings)
.settings(packAutoSettings)
.settings(
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-blaze-server" % "0.13.2",
"org.http4s" %% "http4s-dsl" % "0.13.2",
"org.http4s" %% "http4s-blazeserver" % http4sVersion,
"org.http4s" %% "http4s-dsl" % http4sVersion,
"org.slf4j" % "slf4j-nop" % "1.7.19",
"com.github.alexarchambault" %% "case-app" % "1.0.0-RC2"
)

View File

@ -5,8 +5,9 @@ import java.nio.channels.{ FileLock, OverlappingFileLockException }
import org.http4s.dsl._
import org.http4s.headers.Authorization
import org.http4s.server.HttpService
import org.http4s.server.blaze.BlazeBuilder
import org.http4s.{ BasicCredentials, Challenge, EmptyBody, HttpService, Request, Response }
import org.http4s.{ BasicCredentials, Challenge, EmptyBody, Request, Response }
import caseapp._
@ -122,7 +123,10 @@ case class SimpleHttpServerApp(
auth.credentials match {
case basic: BasicCredentials =>
if (basic.username == user && basic.password == password)
service.run(req)
service.run(req).flatMap {
case Some(v) => Task.now(v)
case None => NotFound()
}
else {
warn {
val msg =