tPrevent serving metadata files - partage - File upload system
(HTM) git clone git://git.z3bra.org/partage.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 262be7013fd0288a16ade778c6ad6602b88d7e87
(DIR) parent 657765130239d212fa9d7a871fd267306bdbd8f8
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Tue, 19 Oct 2021 08:35:26 +0200
Prevent serving metadata files
Diffstat:
M partage.go | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
(DIR) diff --git a/partage.go b/partage.go
t@@ -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)
}
t@@ -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)
}