1
我公開了一個簡單的端點,它包含兩個查詢參數。當我在本地測試代碼時,我沒有任何問題。但是,當部署到PROD我看到以下消息:Akka-http非法請求標題
a.a.ActorSystemImpl Illegal request header: Illegal 'cookie' header: Invalid input '/', expected tchar, '\r', WSP or '=' (line 1, column 186): ...
正如你所看到的,我沒有做任何的cookie解析
import akka.actor.{ActorSystem, Props}
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Directives._
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Sink
object MainApp extends App {
implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer()
private val config = system.settings.config
private val server = Http().bind(config.getString("akka.http.server.interface"), config.getInt("akka.http.server.port"))
private val route = {
path("replay") {
get {
parameters("fromDate", "toDate") { (fromDate, toDate) =>
complete {
<some other code>
}
}
}
}
}
val bindingFuture = server.to(Sink.foreach {
connection =>
connection handleWith route
}).run()
}
任何建議,將不勝感激!
什麼是您的網址? – Rumoku
@rumoku'https:// .com/replay?fromDate = 201604250700&toDate = 201604250705' –
zaxme