Add support for setting stacks when creating session (#138)

* Add support for setting stacks when creating session

* Add exec endpoint and move dns stuff to another package

* Rename command and status code
This commit is contained in:
Marcos Nils
2017-05-11 10:34:16 -03:00
committed by GitHub
parent 24f8c9fc62
commit 62c5d3761d
9 changed files with 187 additions and 86 deletions

View File

@@ -24,6 +24,7 @@ func NewSession(rw http.ResponseWriter, req *http.Request) {
}
reqDur := req.Form.Get("session-duration")
stack := req.Form.Get("stack")
duration := services.GetDuration(reqDur)
s, err := services.NewSession(duration)
@@ -31,7 +32,7 @@ func NewSession(rw http.ResponseWriter, req *http.Request) {
log.Println(err)
//TODO: Return some error code
} else {
s.StackFile = stack
hostname := fmt.Sprintf("%s.%s", config.PWDCName, req.Host)
// If request is not a form, return sessionId in the body
if req.Header.Get("X-Requested-With") == "XMLHttpRequest" {