MCPcopy
hub / github.com/filebrowser/filebrowser / parseQueryFiles

Function parseQueryFiles

http/raw.go:27–46  ·  view source on GitHub ↗
(r *http.Request, f *files.FileInfo, _ *users.User)

Source from the content-addressed store, hash-verified

25}
26
27func parseQueryFiles(r *http.Request, f *files.FileInfo, _ *users.User) ([]string, error) {
28 var fileSlice []string
29 names := strings.Split(r.URL.Query().Get("files"), ",")
30
31 if len(names) == 0 {
32 fileSlice = append(fileSlice, f.Path)
33 } else {
34 for _, name := range names {
35 name, err := url.QueryUnescape(strings.ReplaceAll(name, "+", "%2B"))
36 if err != nil {
37 return nil, err
38 }
39
40 name = slashClean(name)
41 fileSlice = append(fileSlice, filepath.Join(f.Path, name))
42 }
43 }
44
45 return fileSlice, nil
46}
47
48func parseQueryAlgorithm(r *http.Request) (string, archives.Archival, error) {
49 switch r.URL.Query().Get("algo") {

Callers 1

rawDirHandlerFunction · 0.85

Calls 2

slashCleanFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected