mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 19:37:41 +08:00
refactor: pass api_url through context (#457)
* refactor: pass `api_url` through context * 移除 LinkArgs.HttpReq * pref(alias): 减少不必要下载代理 * 修复bug * net: 支持1并发 分片下载
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/subtle"
|
||||
"net/http"
|
||||
"path"
|
||||
@@ -11,7 +10,6 @@ import (
|
||||
"github.com/OpenListTeam/OpenList/server/middlewares"
|
||||
|
||||
"github.com/OpenListTeam/OpenList/internal/conf"
|
||||
"github.com/OpenListTeam/OpenList/internal/model"
|
||||
"github.com/OpenListTeam/OpenList/internal/op"
|
||||
"github.com/OpenListTeam/OpenList/internal/setting"
|
||||
"github.com/OpenListTeam/OpenList/server/webdav"
|
||||
@@ -45,9 +43,7 @@ func WebDav(dav *gin.RouterGroup) {
|
||||
}
|
||||
|
||||
func ServeWebDAV(c *gin.Context) {
|
||||
user := c.MustGet("user").(*model.User)
|
||||
ctx := context.WithValue(c.Request.Context(), "user", user)
|
||||
handler.ServeHTTP(c.Writer, c.Request.WithContext(ctx))
|
||||
handler.ServeHTTP(c.Writer, c.Request.WithContext(c))
|
||||
}
|
||||
|
||||
func WebDAVAuth(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user