sek*_*har 3 scala websocket akka-http
如何修复 Akka HTTP 中增加最大方法长度的问题。我在网络套接字连接服务中遇到以下问题。
\n\nIllegal request, responding with status \'400 Bad Request\': Unsupported\n HTTP method: HTTP method too long (started with \'\xef\xbf\xbc\xef\xbe\x92\xef\xbe\xbfvN\'). Increase \n`akka.http.server.parsing.max-method-length` to support HTTP methods with more characters.\nRun Code Online (Sandbox Code Playgroud)\n\n我已在application.conf中添加了akka.http.server.parsing.max-method-length。\n添加max-method-length后也遇到了同样的问题,我的 .conf 文件是:
\n\n app {\n interface = "0.0.0.0"\n port = 7000\n}\n\n# Cors allowed origin configuration\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ncors {\n allowed-origin = "http://127.0.0.1"\n}\n\n\nakka {\n http {\n server.parsing.illegal-header-warnings = off\n client.parsing.illegal-header-warnings = off\n }\n}\nakka.http.server.parsing.max-method-length =500\nRun Code Online (Sandbox Code Playgroud)\n
小智 5
我遇到了同样的错误,并且也没有成功更改 max-method-length conf 值。
我的问题是我的请求 URL 错误地使用了 https 而不是 http。将我的请求更改为 http:// 后,上述错误不再发生