MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / FsGetSplit

Function FsGetSplit

server/handles/fsread.go:264–281  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

262}
263
264func FsGetSplit(c *gin.Context) {
265 var req FsGetReq
266 if err := c.ShouldBind(&req); err != nil {
267 common.ErrorResp(c, err, 400)
268 return
269 }
270 if strings.HasPrefix(req.Path, "/@s") {
271 req.Path = strings.TrimPrefix(req.Path, "/@s")
272 SharingGet(c, &req)
273 return
274 }
275 user := c.Request.Context().Value(conf.UserKey).(*model.User)
276 if user.IsGuest() && user.Disabled {
277 common.ErrorStrResp(c, "Guest user is disabled, login please", 401)
278 return
279 }
280 FsGet(c, &req, user)
281}
282
283func FsGet(c *gin.Context, req *FsGetReq, user *model.User) {
284 reqPath, err := user.JoinPath(req.Path)

Callers

nothing calls this directly

Calls 5

ErrorRespFunction · 0.92
ErrorStrRespFunction · 0.92
SharingGetFunction · 0.85
FsGetFunction · 0.85
IsGuestMethod · 0.80

Tested by

no test coverage detected