From 20d1dcca4d6f4681f93a6efc483c106834956f2c Mon Sep 17 00:00:00 2001 From: Remco Date: Thu, 18 Dec 2014 23:11:18 +0100 Subject: [PATCH] fixed issue with uploading files colliding with static files. --- transfersh-server/main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/transfersh-server/main.go b/transfersh-server/main.go index bc3accc..21b7201 100644 --- a/transfersh-server/main.go +++ b/transfersh-server/main.go @@ -75,13 +75,13 @@ func main() { r := mux.NewRouter() - r.PathPrefix("/scripts/").Handler(http.FileServer(http.Dir("./static/"))) - r.PathPrefix("/styles/").Handler(http.FileServer(http.Dir("./static/"))) - r.PathPrefix("/images/").Handler(http.FileServer(http.Dir("./static/"))) - r.PathPrefix("/fonts/").Handler(http.FileServer(http.Dir("./static/"))) - r.PathPrefix("/ico/").Handler(http.FileServer(http.Dir("./static/"))) - r.PathPrefix("/favicon.ico").Handler(http.FileServer(http.Dir("./static/"))) - r.PathPrefix("/robots.txt").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/scripts/").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/styles/").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/images/").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/fonts/").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/ico/").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/favicon.ico").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) + r.PathPrefix("/robots.txt").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) r.HandleFunc("/({files:.*}).zip", zipHandler).Methods("GET") r.HandleFunc("/({files:.*}).tar", tarHandler).Methods("GET")