Repository: AlistGo/alist (language: go)

Issue:
Tampermonkey 同步失败
### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

- [X] I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。

- [X] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题，而不是其他原因（例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host)，`依赖`或`操作`）。

- [X] I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。


### AList Version / AList 版本

v3.33.0

### Driver used / 使用的存储驱动

本机存储

### Describe the bug / 问题描述

使用 Tampermonkey v5.1.0 同步（Alist WebDAV）时，请求无限循环：
<img width="1775" alt="image" src="https://github.com/alist-org/alist/assets/20217146/4834704d-bb80-4454-88cf-1d596f1c7614">
使用另一个 [WebDAV](https://hub.docker.com/r/bytemark/webdav) 实现时，正常同步，没有出现无限循环：
<img width="1772" alt="image" src="https://github.com/alist-org/alist/assets/20217146/49e7c244-d766-40e6-990c-ce4d2adaad0e">
好像是响应不一样


### Reproduction / 复现链接

使用 Tampermonkey v5.1.0 同步（Alist WebDAV）

### Config / 配置

<img width="1283" alt="image" src="https://github.com/alist-org/alist/assets/20217146/7d4e59fe-6c4e-4ae1-8787-ffb96cafeb13">


### Logs / 日志

```
[GIN] 2024/04/04 - 17:59:47 | 200 |     124.592µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |     103.384µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |      62.412µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |       64.91µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |      92.331µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |      63.397µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |     107.315µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |      77.674µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
[GIN] 2024/04/04 - 17:59:47 | 200 |      63.278µs |       10.7.21.3 | SUBSCRIBE  "/dav/Tampermonkey/sync/"
```


Discussion / hints:
FYI: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/207
无法复现
<img width="1115" alt="image" src="https://github.com/alist-org/alist/assets/36558727/4ae5653b-da1d-4d7c-940d-f2261255ae6f">
请确认你填的地址可以上传文件，例如填的是 https://xx.com/dav 即根路径，但不存在根路径存储（即挂载路径为/的存储），则无法找到上传位置。
我填的是 /dav 啊，你看我这路径应该是对的吧？我记得 Tampermonkey 5.0 的时候是正常的，最近看 Nginx 日志发现的。
<img width="926" alt="image" src="https://github.com/alist-org/alist/assets/20217146/387e20fe-d350-4959-8516-b6b13e723d01">
<img width="920" alt="image" src="https://github.com/alist-org/alist/assets/20217146/dc05d56c-3616-4356-ade7-19febef414b9">

填/dav 需要有挂载路径为/的存储 看下后台是否有。
是这样看吗
<img width="571" alt="image" src="https://github.com/alist-org/alist/assets/20217146/84088179-e9df-4a70-b2e3-60b95557575e">


<img width="804" alt="image" src="https://github.com/alist-org/alist/assets/20217146/79ca5501-9232-4286-a61b-d30e5e0594d6">

是的

如果没有就要填具体路径
<img width="1312" alt="image" src="https://github.com/alist-org/alist/assets/20217146/36827cd6-b19c-4482-898e-388e54079a7c">
加上去重启了还是一样的
> 无法复现 <img alt="image" width="1115" src="https://private-user-images.githubusercontent.com/36558727/319541966-4ae5653b-da1d-4d7c-940d-f2261255ae6f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTIyMjkzNDgsIm5iZiI6MTcxMjIyOTA0OCwicGF0aCI6Ii8zNjU1ODcyNy8zMTk1NDE5NjYtNGFlNTY1M2ItZGExZC00ZDdjLTk0MGQtZjIyNjEyNTVhZTZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNDA0VDExMTA0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjZGEyNTVkNTYzNDVmNjVmOTk2N2ExZmRlNzdiZGQ5ODVkYmNiMGM3ODE2YmYzNmNhZmZkZjA0ZTI0MmJjNTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.RVNQ7hdDOcABGpaDpc9kdkW42SfS27bmeWsa1DW5yS4"> 请确认你填的地址可以上传文件，例如填的是 https://xx.com/dav 即根路径，但不存在根路径存储（即挂载路径为/的存储），则无法找到上传位置。

我发现这里不太一样，我是在“设置>脚本同步”里，不是“实用工具”里，我的导出也正常
我注意到 Tampermonkey v5.1.0 确实更改了 WebDAV 相关的功能：https://www.tampermonkey.net/changelog.php#v5.1.0
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hello @, this issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.
tampermonkey v5.3.3 也是遇到同样问题，切换到坚果云webdav就正常了

Fix patch:
diff --git a/server/static/static.go b/server/static/static.go
index ec16014c22b..d5d6ff685cd 100644
--- a/server/static/static.go
+++ b/server/static/static.go
@@ -102,6 +102,10 @@ func Static(r *gin.RouterGroup, noRoute func(handlers ...gin.HandlerFunc)) {
 	}
 
 	noRoute(func(c *gin.Context) {
+		if c.Request.Method != "GET" && c.Request.Method != "POST" {
+			c.Status(405)
+			return
+		}
 		c.Header("Content-Type", "text/html")
 		c.Status(200)
 		if strings.HasPrefix(c.Request.URL.Path, "/@manage") {


Test patch: