小编Nea*_*atZ的帖子

使用 Fast API 收到无效的 HTTP 请求

我有一个 React 前端向运行 FastAPI 的 Discord.py 机器人发出请求。在我的测试环境中一切都很好,但是当我部署到远程主机时 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 …
Run Code Online (Sandbox Code Playgroud)

reactjs fastapi uvicorn

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

fastapi ×1

reactjs ×1

uvicorn ×1