Merge pull request #113 from harshavardhana/pr_out_add_strictslash_for_path_re_direction

master
Harshavardhana 10 years ago
commit 862ce975d5
  1. 2
      pkg/api/minioapi/minioapi.go
  2. 9
      pkg/api/webuiapi/webuiapi.go

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

@ -29,14 +29,9 @@ type webUiApi struct {
func HttpHandler() http.Handler { func HttpHandler() http.Handler {
mux := mux.NewRouter() mux := mux.NewRouter()
var api = webUiApi{} var api = webUiApi{}
mux.StrictSlash(true)
mux.HandleFunc("/", api.homeHandler).Methods("GET") 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 return mux
} }

Loading…
Cancel
Save