fileserver stripprefix 수정
This commit is contained in:
@ -46,15 +46,11 @@ func (h *houstonHandler) RegisterHandlers(serveMux *http.ServeMux, prefix string
|
||||
logger.Println("houstonHandler registed")
|
||||
serveMux.Handle("/"+path.Join(prefix, "houston"), h)
|
||||
|
||||
dfsx := http.FileServer(http.Dir("./deploys"))
|
||||
serveMux.Handle(
|
||||
"/"+path.Join(prefix, "deploys", "/"),
|
||||
http.StripPrefix(fmt.Sprintf("/%s/deploys", prefix), dfsx))
|
||||
fsx := http.FileServer(http.Dir("./deploys"))
|
||||
serveMux.Handle(fmt.Sprintf("/%s/deploys/", prefix), http.StripPrefix(fmt.Sprintf("/%s/deploys/", prefix), fsx))
|
||||
|
||||
ufsx := http.FileServer(http.Dir("./downloads"))
|
||||
serveMux.Handle(
|
||||
"/"+path.Join(prefix, "downloads", "/"),
|
||||
http.StripPrefix(fmt.Sprintf("/%s/downloads", prefix), ufsx))
|
||||
serveMux.Handle(fmt.Sprintf("/%s/downloads/", prefix), http.StripPrefix(fmt.Sprintf("/%s/downloads/", prefix), ufsx))
|
||||
|
||||
serveMux.HandleFunc("/"+path.Join(prefix, "upload"), func(w http.ResponseWriter, r *http.Request) {
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user