1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-15 02:37:27 +08:00

Revert "Add CORS to create session and make it return text plain session ID"

This reverts commit c81a712a28eba960a4bcdc078cb51a1a4f832dbb.
This commit is contained in:
Marcos Lilljedahl 2017-01-13 19:27:07 -03:00
parent c81a712a28
commit c1cfc7958a
2 changed files with 1 additions and 6 deletions

2
api.go
View File

@ -79,7 +79,7 @@ func main() {
} }
}).Methods("GET") }).Methods("GET")
r.Handle("/", c.Handler(http.HandlerFunc(handlers.NewSession))).Methods("POST") r.HandleFunc("/", handlers.NewSession).Methods("POST")
n := negroni.Classic() n := negroni.Classic()
n.UseHandler(r) n.UseHandler(r)

View File

@ -21,11 +21,6 @@ func NewSession(rw http.ResponseWriter, req *http.Request) {
log.Println(err) log.Println(err)
//TODO: Return some error code //TODO: Return some error code
} else { } else {
// If request is not a form, return sessionId in the body
if req.Header.Get("Content-Type") != "application/x-www-form-urlencoded" {
rw.Write([]byte(s.Id))
return
}
http.Redirect(rw, req, fmt.Sprintf("/p/%s", s.Id), http.StatusFound) http.Redirect(rw, req, fmt.Sprintf("/p/%s", s.Id), http.StatusFound)
} }
} }