Merge pull request #14 from fkautz/pr_out_handler_now_only_listens_to_get_requests

handler now only listens to GET requests
This commit is contained in:
Harshavardhana 2015-01-18 16:57:26 -08:00
commit 3f03ce7334
1 changed files with 2 additions and 2 deletions

View File

@ -60,11 +60,11 @@ func createSelectCases(channels []<-chan error) []reflect.SelectCase {
func getHttpHandler() http.Handler { func getHttpHandler() http.Handler {
mux := mux.NewRouter() mux := mux.NewRouter()
mux.HandleFunc("/{bucket}/{object:.*}", storageHandler) mux.HandleFunc("/{bucket}/{object:.*}", getObjectHandler).Methods("GET")
return mux return mux
} }
func storageHandler(w http.ResponseWriter, req *http.Request) { func getObjectHandler(w http.ResponseWriter, req *http.Request) {
vars := mux.Vars(req) vars := mux.Vars(req)
bucket := vars["bucket"] bucket := vars["bucket"]
object := vars["object"] object := vars["object"]