From a4a1652b72a4fc0fb784f08152ef31f97534c76d Mon Sep 17 00:00:00 2001
From: Tom Clegg
Date: Mon, 12 Jun 2017 16:59:09 -0400
Subject: [PATCH] 8784: Correct wget args, tweak styles.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg
---
services/keep-web/handler.go | 32 ++++++++++++---
services/keep-web/handler_test.go | 65 ++++++++++++++++++-------------
2 files changed, 65 insertions(+), 32 deletions(-)
diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index a37cfb70b3..be6049a282 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -340,7 +340,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
} else if stat.IsDir() && !strings.HasSuffix(r.URL.Path, "/") {
h.seeOtherWithCookie(w, r, basename+"/", credentialsOK)
} else if stat.IsDir() {
- h.serveDirectory(w, r, &coll, fs, openPath)
+ h.serveDirectory(w, r, &coll, fs, openPath, stripParts)
} else {
http.ServeContent(w, r, basename, stat.ModTime(), f)
if int64(w.WroteBodyBytes()) != stat.Size() {
@@ -352,7 +352,27 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
}
var dirListingTemplate = `
-{{ .Collection.Name }}
+
+
+ {{ .Collection.Name }}
+
+
{{ .Collection.Name }}
@@ -360,7 +380,7 @@ var dirListingTemplate = `
Arvados. You can download individual files listed below. To download
the entire collection with wget, try:
-$ wget --mirror --no-parent --no-host --cut-dirs=3 {{ .Request.URL }}
+$ wget --mirror --no-parent --no-host --cut-dirs={{ .StripParts }} https://{{ .Request.Host }}{{ .Request.URL }}
File Listing
@@ -368,9 +388,10 @@ the entire collection with wget, try:
{{range .Files}} {{.}}{{end}}
+