Skip to content

Commit

Permalink
Merge pull request #20 from bento-platform/qa/v3.2
Browse files Browse the repository at this point in the history
qa/v3.2 -> v3.2.1
  • Loading branch information
brouillette authored Jan 13, 2022
2 parents 46ace61 + 9694b88 commit 2dfb885
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/api/mvc/variants.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ func VariantsIngest(c echo.Context) error {
return c.JSON(http.StatusBadRequest, "{\"error\" : \"Missing 'fileNames' query parameter!\"}")
} else {
// remove DRS bridge directory base path from the requested filenames (if present)
fileNames[i] = strings.ReplaceAll(fileName, cfg.Drs.BridgeDirectory, "")
if strings.HasPrefix(fileName, cfg.Drs.BridgeDirectory) {
replaced := strings.Replace(fileName, cfg.Drs.BridgeDirectory, "", 1)

replacedDirectory, replacedFileName := path.Split(replaced)
// strip the leading '/' away
if replacedDirectory == "/" {
fileNames[i] = replacedFileName
} else {
fileNames[i] = replaced
}
}
}
}

Expand Down

0 comments on commit 2dfb885

Please sign in to comment.