Added HEAD Support
This commit is contained in:
parent
fc1c76125f
commit
adb32a946c
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,9 @@ type AuthManager interface {
|
||||||
|
|
||||||
func StartServer(conf ServerConf, auth *AuthManager) {
|
func StartServer(conf ServerConf, auth *AuthManager) {
|
||||||
handler := mux.NewRouter()
|
handler := mux.NewRouter()
|
||||||
handler.PathPrefix(conf.BasePath).Methods("GET").Handler(http.StripPrefix(conf.BasePath, http.FileServer(http.Dir(conf.MavenPath))))
|
fileserver := http.FileServer(http.Dir(conf.MavenPath))
|
||||||
|
handler.PathPrefix(conf.BasePath).Methods("GET").Handler(http.StripPrefix(conf.BasePath, fileserver))
|
||||||
|
handler.PathPrefix(conf.BasePath).Methods("HEAD").Handler(http.StripPrefix(conf.BasePath, fileserver))
|
||||||
handler.PathPrefix(conf.BasePath).Methods("PUT").Handler(http.StripPrefix(conf.BasePath, PutHandler{rootpath: conf.MavenPath, auth: auth}))
|
handler.PathPrefix(conf.BasePath).Methods("PUT").Handler(http.StripPrefix(conf.BasePath, PutHandler{rootpath: conf.MavenPath, auth: auth}))
|
||||||
err := http.ListenAndServe("0.0.0.0:"+strconv.Itoa(conf.Port), handler)
|
err := http.ListenAndServe("0.0.0.0:"+strconv.Itoa(conf.Port), handler)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue