Repository: nonebot/nonebot2

Issue:
Bug: Nonebot2通过正向Websocket连接go-cqhttp报错400
**描述问题：**

在目前最新的Nonebot2的release中使用websocket与go-cqhttp进行连接会报错400。
这个问题仅出现在了Linux端上，在Win环境下并不会出现400错误（无论是go-cqhttp运行在linux还是win下）。
此问题已经在私下测试完成复现了很多次。

**如何复现？**

前提条件：
- go-cqhttp已完成配置，连接协议为ws，host为127.0.0.1，port为6700，不启用access_token
- 已完成安装nb-cli并安装nonebot-adapter-cqhttp且创建了一个新的机器人，使用cqhttp（Nonebot2）、.env.dev已添加配置 ` CQHTTP_WS_URLS={"2461591632": "ws://127.0.0.1:6700/"} `

1. 先行启动go-cqhttp服务
2. 然后启动nonebot2机器人

**期望的结果**
go-cqhttp并没有任何报错，所以不贴东西了。

Nonebot2端报错：
```python
10-11 11:49:35 [ERROR] nonebot | Error while connecting to ws://127.0.0.1:6700/. Try to reconnect...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/usr/lib/python3.9/multiprocessing/spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ls420/.local/lib/python3.9/site-packages/uvicorn/subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "/home/ls420/.local/lib/python3.9/site-packages/uvicorn/server.py", line 68, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
> File "/usr/local/lib/python3.9/dist-packages/nonebot/drivers/fastapi.py", line 489, in _ws_loop
    async with connection as ws:
  File "/home/ls420/.local/lib/python3.9/site-packages/websockets/legacy/client.py", line 604, in __aenter__
    return await self
  File "/home/ls420/.local/lib/python3.9/site-packages/websockets/legacy/client.py", line 629, in __await_impl__
    await protocol.handshake(
  File "/home/ls420/.local/lib/python3.9/site-packages/websockets/legacy/client.py", line 388, in handshake
    raise InvalidStatusCode(status_code)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 400
```

**环境信息：**

 - OS: [Ubuntu20.04-LTS_arm64/amd64]
 - Python Version: [3.9.5]
 - Nonebot Version: [2.0.0a16]

**协议端信息：**

 - 协议端: [go-cqhttp]
 - 协议端版本: [v1.0.0-beta7-fix2]

**截图或日志**




Discussion:
> CQHTTP_WS_URLS={"QQ": "ws://127.0.0.1:6700/"}

请正确填写你的QQ号
> > CQHTTP_WS_URLS={"QQ": "ws://127.0.0.1:6700/"}
> 
> 请正确填写你的QQ号

Done
依然报错？
> 依然报错？

这个错误本身与这个无关的，只是我懒没写上QQ号😶

Resolving patch:
diff --git a/nonebot/drivers/fastapi.py b/nonebot/drivers/fastapi.py
--- a/nonebot/drivers/fastapi.py
+++ b/nonebot/drivers/fastapi.py
@@ -480,7 +480,7 @@ async def _ws_loop(self, setup: WEBSOCKET_SETUP):
                     )
                     return
 
-                headers = {**setup_.headers, "host": url.netloc.decode("ascii")}
+                headers = setup_.headers.copy()
                 logger.debug(
                     f"Bot {setup_.self_id} from adapter {setup_.adapter} connecting to {url}"
                 )


Test patch: