mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-04 17:33:21 +08:00
Allow to override session timeout. (#86)
* Allow to override session timeout. This comes useful as it can be overriden from the SDK now * Fix comments
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func NewSession(rw http.ResponseWriter, req *http.Request) {
|
||||
req.ParseForm()
|
||||
if !services.IsHuman(req) {
|
||||
// User it not a human
|
||||
rw.WriteHeader(http.StatusConflict)
|
||||
@@ -16,7 +17,10 @@ func NewSession(rw http.ResponseWriter, req *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
s, err := services.NewSession()
|
||||
reqDur := req.Form.Get("session-duration")
|
||||
|
||||
duration := services.GetDuration(reqDur)
|
||||
s, err := services.NewSession(duration)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
//TODO: Return some error code
|
||||
|
Reference in New Issue
Block a user