Strip path from initial request and consistency changes

This commit is contained in:
Henrique Dias committed 2017-06-27 10:45:06 +01:00
1 parent 6bce6fb584
commit 5f98fd89a8
7 files changed
+50 -51

No files matched your search

+5 -5
View File
@@ -14,7 +14,7 @@ func serveListing(ctx *requestContext, w http.ResponseWriter, r *http.Request) (
var err error
// Loads the content of the directory
listing, err := getListing(ctx.User, ctx.Info.VirtualPath, ctx.FileManager.PrefixURL+ctx.FileManager.BaseURL+r.URL.Path)
listing, err := getListing(ctx.User, ctx.Info.VirtualPath, ctx.FileManager.RootURL()+r.URL.Path)
if err != nil {
return errorToHTTP(err, true), err
}
@@ -25,7 +25,7 @@ func serveListing(ctx *requestContext, w http.ResponseWriter, r *http.Request) (
URL: r.URL,
}
cookieScope := ctx.FileManager.BaseURL
cookieScope := ctx.FileManager.RootURL()
if cookieScope == "" {
cookieScope = "/"
}
@@ -83,9 +83,9 @@ func serveListing(ctx *requestContext, w http.ResponseWriter, r *http.Request) (
Path: ctx.Info.VirtualPath,
IsDir: true,
User: ctx.User,
PrefixURL: ctx.FileManager.PrefixURL,
BaseURL: ctx.FileManager.AbsoluteURL(),
WebDavURL: ctx.FileManager.AbsoluteWebDavURL(),
PrefixURL: ctx.FileManager.prefixURL,
BaseURL: ctx.FileManager.RootURL(),
WebDavURL: ctx.FileManager.WebDavURL(),
Display: displayMode,
Data: listing,
}