如何修复 Akka HTTP 中增加最大方法长度的问题。我在 Web 套接字连接服务中遇到以下问题。
Illegal request, responding with status '400 Bad Request': Unsupported
HTTP method: HTTP method too long (started with 'メvN'). Increase
`akka.http.server.parsing.max-method-length` to support HTTP methods with more characters.
我在application.conf添加了akka.http.server.parsing.max-method-length。添加max-method-length后,我也遇到了同样的问题,我的 .conf 文件是:
app {
interface = "0.0.0.0"
port = 7000
}
# Cors allowed origin configuration
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cors {
allowed-origin = "http://127.0.0.1"
}
akka {
http {
server.parsing.illegal-header-warnings = off
client.parsing.illegal-header-warnings = off
}
}
akka.http.server.parsing.max-method-length =500