Add StrictSlash for path re-direction

This commit is contained in:
Harshavardhana 2015-02-01 02:49:09 -08:00
parent 3ed884e495
commit b635501fb7
2 changed files with 4 additions and 7 deletions

View File

@ -54,6 +54,8 @@ func HttpHandler(storage mstorage.Storage) http.Handler {
var api = minioApi{}
api.storage = storage
// Re-direct /path to /path/
mux.StrictSlash(true)
mux.HandleFunc("/", api.listBucketsHandler).Methods("GET")
mux.HandleFunc("/{bucket}/", api.listObjectsHandler).Methods("GET")
mux.HandleFunc("/{bucket}/", api.putBucketHandler).Methods("PUT")

View File

@ -29,14 +29,9 @@ type webUiApi struct {
func HttpHandler() http.Handler {
mux := mux.NewRouter()
var api = webUiApi{}
mux.StrictSlash(true)
mux.HandleFunc("/", api.homeHandler).Methods("GET")
/*
mux.HandleFunc("/{bucket}/", api.listObjectsHandler).Methods("GET")
mux.HandleFunc("/{bucket}/", api.putBucketHandler).Methods("PUT")
mux.HandleFunc("/{bucket}/{object:.*}", api.getObjectHandler).Methods("GET")
mux.HandleFunc("/{bucket}/{object:.*}", api.headObjectHandler).Methods("HEAD")
mux.HandleFunc("/{bucket}/{object:.*}", api.putObjectHandler).Methods("PUT")
*/
return mux
}