mirror of
https://github.com/rclone/rclone.git
synced 2026-01-04 01:23:24 +00:00
http: improved directory listing with new template from Caddy project
This includes a new directory listing template which was originally from the Caddy project (used with permission and copyright attribution). This is used whenever we serve directory listings so `rclone serve http`, `rclone serve webdav` and `rclone rcd --rc-serve` This also modifies the tests so they work with the original template which is easier to debug.
This commit is contained in:
@@ -33,6 +33,7 @@ const (
|
||||
testBindAddress = "localhost:0"
|
||||
testUser = "user"
|
||||
testPass = "pass"
|
||||
testTemplate = "../http/testdata/golden/testindex.html"
|
||||
)
|
||||
|
||||
// check interfaces
|
||||
@@ -51,6 +52,7 @@ func TestWebDav(t *testing.T) {
|
||||
opt.ListenAddr = testBindAddress
|
||||
opt.BasicUser = testUser
|
||||
opt.BasicPass = testPass
|
||||
opt.Template = testTemplate
|
||||
hashType = hash.MD5
|
||||
|
||||
// Start the server
|
||||
@@ -94,6 +96,7 @@ func TestHTTPFunction(t *testing.T) {
|
||||
|
||||
opt := httplib.DefaultOpt
|
||||
opt.ListenAddr = testBindAddress
|
||||
opt.Template = testTemplate
|
||||
|
||||
// Start the server
|
||||
w := newWebDAV(f, &opt)
|
||||
|
||||
Reference in New Issue
Block a user