Merge "app/publisher: use relative paths in filenames within zip"

This commit is contained in:
Mathieu Lonjaret 2017-04-26 14:19:34 +00:00 committed by Gerrit Code Review
commit 5d6c006be3
1 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ func (zh *zipHandler) blobList(dirPath string, dirBlob blob.Ref) ([]*blobFile, e
var list []*blobFile
if isDir {
dirRoot := dirBlobPath[1]
children, err := zh.blobsFromDir("/", dirRoot)
children, err := zh.blobsFromDir("", dirRoot)
if err != nil {
return nil, fmt.Errorf("Could not get list of blobs from %v: %v", dirRoot, err)
}
@ -234,7 +234,7 @@ func (zh *zipHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
http.Error(rw, "Invalid method", http.StatusMethodNotAllowed)
return
}
bf, err := zh.blobList("/", zh.root)
bf, err := zh.blobList("", zh.root)
if err != nil {
log.Printf("Could not serve zip for %v: %v", zh.root, err)
http.Error(rw, "Server error", http.StatusInternalServerError)