Skip to content

Commit

Permalink
Fixup for test:
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall committed Nov 19, 2024
1 parent ce67528 commit 017e9a3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/handlers/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ func CheckMyWork(w http.ResponseWriter, r *http.Request) {
// make sure the file exists in the filesystem
case "File Path", "Supplemental File":
filename := strings.ReplaceAll(cell, `\`, `/`)
filename = strings.TrimLeft(filename, "/")
if len(filename) > 3 && filename[0:3] != "mnt" {
filename = fmt.Sprintf("/mnt/islandora_staging/%s", filename)
// we're testing with /tmp files
if len(filename) < 6 || filename[0:5] != "/tmp/" {
// but need to make sure we're mapping /mnt/islandora_staging into /data in docker
filename = strings.TrimLeft(filename, "/")
if len(filename) > 3 && filename[0:3] != "mnt" {
filename = fmt.Sprintf("/mnt/islandora_staging/%s", filename)
}
}

filename = strings.ReplaceAll(filename, "/mnt/islandora_staging", "/data")
Expand Down Expand Up @@ -257,7 +261,7 @@ func fileExists(filename string) bool {

mode := info.Mode().Perm()
// Check if the file is globally readable
return mode&0404 != 0
return mode&0004 != 0
}

func authRequest(w http.ResponseWriter, r *http.Request) bool {
Expand Down

0 comments on commit 017e9a3

Please sign in to comment.