fixed some path issues
This commit is contained in:
parent
ffeeae5702
commit
38c2a72fe0
5 changed files with 22 additions and 28 deletions
|
|
@ -161,9 +161,10 @@ func registerHandler(ctx *Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func fileHandler(ctx *Context) {
|
||||
func rawHandler(ctx *Context) {
|
||||
defer ctx.Log()
|
||||
f, fi, err := ctx.Srv.FS.GetFile(ctx.Path())
|
||||
path := strings.TrimPrefix(ctx.Path(), core.RawPrefix)
|
||||
f, fi, err := ctx.Srv.FS.GetFile(path)
|
||||
if err != nil {
|
||||
ctx.Status(http.StatusNotFound)
|
||||
err = ctx.Write([]byte(noSuchFile))
|
||||
|
|
@ -356,6 +357,7 @@ func deleteHandler(ctx *Context) {
|
|||
if err != nil {
|
||||
log.Printf("db: delete: %s %s", f, err)
|
||||
}
|
||||
log.Debugf("delete %s id: %s from index", f, id)
|
||||
if id == "" {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var prefixRoutes = []route{
|
|||
core.RawPrefix,
|
||||
jwtHandler(
|
||||
authHandler(
|
||||
fileHandler)),
|
||||
rawHandler)),
|
||||
[]string{"GET"},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue