(c *gin.Context)
| 72 | } |
| 73 | |
| 74 | func FsArchiveMetaSplit(c *gin.Context) { |
| 75 | var req ArchiveMetaReq |
| 76 | if err := c.ShouldBind(&req); err != nil { |
| 77 | common.ErrorResp(c, err, 400) |
| 78 | return |
| 79 | } |
| 80 | if strings.HasPrefix(req.Path, "/@s") { |
| 81 | req.Path = strings.TrimPrefix(req.Path, "/@s") |
| 82 | SharingArchiveMeta(c, &req) |
| 83 | return |
| 84 | } |
| 85 | user := c.Request.Context().Value(conf.UserKey).(*model.User) |
| 86 | if user.IsGuest() && user.Disabled { |
| 87 | common.ErrorStrResp(c, "Guest user is disabled, login please", 401) |
| 88 | return |
| 89 | } |
| 90 | FsArchiveMeta(c, &req, user) |
| 91 | } |
| 92 | |
| 93 | func FsArchiveMeta(c *gin.Context, req *ArchiveMetaReq, user *model.User) { |
| 94 | if !user.CanReadArchives() { |
nothing calls this directly
no test coverage detected