我有一个反应前端,向运行Discord.py的FastAPI机器人发出请求。我的测试环境很好,但是当我部署到远程主机时,uvicorn会抱怨
WARNING: Invalid HTTP request received.
Traceback (most recent call last):
File "/home/container/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
event = self.conn.next_event()
File "/home/container/h11/_connection.py", line 443, in next_event
exc._reraise_as_remote_protocol_error()
File "/home/container/h11/_util.py", line 76, in _reraise_as_remote_protocol_error
raise self
File "/home/container/h11/_connection.py", line 425, in next_event
event = self._extract_next_receive_event()
File "/home/container/h11/_connection.py", line 367, in _extract_next_receive_event
event = self._reader(self._receive_buffer)
File "/home/container/h11/_readers.py", line 68, in maybe_read_from_IDLE_client
raise LocalProtocolError("illegal request line")
h11._util.RemoteProtocolError: illegal request line
2022-01-15 22:59:11,310 - Invalid HTTP request received.
Traceback (most recent call last):
File "/home/container/uvicorn/protocols/http/h11_impl.py", line 136, in handle_events
event = self.conn.next_event()
File "/home/container/h11/_connection.py", line 443, in next_event
exc._reraise_as_remote_protocol_error()
File "/home/container/h11/_util.py", line 76, in _reraise_as_remote_protocol_error
raise self
File "/home/container/h11/_connection.py", line 425, in next_event
event = self._extract_next_receive_event()
File "/home/container/h11/_connection.py", line 367, in _extract_next_receive_event
event = self._reader(self._receive_buffer)
File "/home/container/h11/_readers.py", line 68, in maybe_read_from_IDLE_client
raise LocalProtocolError("illegal request line")
h11._util.RemoteProtocolError: illegal request line
此外,如果我通过邮递员提出要求,一切都正常。这是我的主机的问题,还是我丢失的uvicorn配置的问题?
发布于 2022-01-16 02:10:36
当microservice不支持HTTPS时,将url
从https
更改为http
https://stackoverflow.com/questions/70726187
复制相似问题