Skip to content

Commit

Permalink
dont error for old clients
Browse files Browse the repository at this point in the history
  • Loading branch information
nzoschke committed Apr 19, 2016
1 parent 7f9a91d commit 148a28f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/controllers/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,19 @@ func AppLogs(ws *websocket.Conn) *httperr.Error {
app := mux.Vars(ws.Request())["app"]
header := ws.Request().Header

var err error

follow := true
if header.Get("Follow") == "false" {
follow = false
}

since, err := time.ParseDuration(header.Get("Since"))
if err != nil {
return httperr.Errorf(403, "Invalid duration %s", header.Get("Since"))
since := 2 * time.Minute
if s := header.Get("Since"); s != "" {
since, err = time.ParseDuration(s)
if err != nil {
return httperr.Errorf(403, "Invalid duration %s", s)
}
}

err = provider.LogStream(app, ws, structs.LogStreamOptions{
Expand Down

0 comments on commit 148a28f

Please sign in to comment.