partage

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/partage.git
Log | Files | Refs

commit 262be7013fd0288a16ade778c6ad6602b88d7e87
parent 657765130239d212fa9d7a871fd267306bdbd8f8
Author: Willy Goiffon <dev@z3bra.org>
Date:   Tue, 19 Oct 2021 08:35:26 +0200

Prevent serving metadata files

Diffstat:
Mpartage.go | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/partage.go b/partage.go @@ -175,8 +175,7 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) { writemeta(tmp.Name(), conf.expiry) - //link := conf.baseuri + conf.filectx + filepath.Base(tmp.Name()) - link := conf.baseuri + conf.metactx + filepath.Base(tmp.Name()) + ".json" + link := conf.baseuri + conf.filectx + filepath.Base(tmp.Name()) links = append(links, link) } @@ -230,6 +229,5 @@ func main() { http.HandleFunc("/", uploader) http.Handle(conf.filectx, http.StripPrefix(conf.filectx, http.FileServer(http.Dir(conf.filepath)))) - http.Handle(conf.metactx, http.StripPrefix(conf.metactx, http.FileServer(http.Dir(conf.metapath)))) http.ListenAndServe("0.0.0.0:8080", nil) }