浏览代码

fixed issue with uploading files colliding with static files.

tags/v1.0.0
Remco 9 年前
父节点
当前提交
20d1dcca4d
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. +7
    -7
      transfersh-server/main.go

+ 7
- 7
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")


正在加载...
取消
保存