Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-03-01 13:50:40 +0300
committerKamil Trzciński <ayufan@ayufan.eu>2019-03-01 13:50:40 +0300
commit4e76dfe52232b100321ca65f9e511dde7dc7d832 (patch)
treedaef4b79b7aeae83fa2f84eef67abbd84a9a2d38 /internal/domain
parent89e88540533def25a6e4ec6e7c1dc1b5b74d3db8 (diff)
Plug-in zip archive
Diffstat (limited to 'internal/domain')
-rw-r--r--internal/domain/domain.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/domain/domain.go b/internal/domain/domain.go
index 6f09eaf0..3d7bc42d 100644
--- a/internal/domain/domain.go
+++ b/internal/domain/domain.go
@@ -208,7 +208,7 @@ func (d *D) detectContentType(storage storage.S, path string) (string, error) {
func (d *D) serveFile(w http.ResponseWriter, r *http.Request, storage storage.S, origPath string) error {
fullPath := d.handleGZip(w, r, storage, origPath)
- file, fi, err := storage.Open(fullPath)
+ file, _, err := storage.Open(fullPath)
if err != nil {
return err
}
@@ -226,7 +226,10 @@ func (d *D) serveFile(w http.ResponseWriter, r *http.Request, storage storage.S,
}
w.Header().Set("Content-Type", contentType)
- http.ServeContent(w, r, origPath, fi.ModTime(), file)
+
+ // TODO: dump-copy content as Zip file does not support seeking
+ io.Copy(w, file)
+ //http.ServeContent(w, r, origPath, fi.ModTime(), file)
return nil
}