Skip to content

Commit

Permalink
Update due protocol changes: https://github.com/mozilla/geckodriver/r…
Browse files Browse the repository at this point in the history
  • Loading branch information
aandryashin committed Mar 15, 2017
1 parent db53fb4 commit 34db1a4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions selenoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ func create(w http.ResponseWriter, r *http.Request) {
}
w.WriteHeader(resp.StatusCode)
var s struct {
Value struct {
ID string `json:"sessionId"`
}
ID string `json:"sessionId"`
}
tee := io.TeeReader(resp.Body, w)
json.NewDecoder(tee).Decode(&s)
if s.ID == "" {
s.ID = s.Value.ID
}
if s.ID == "" {
log.Printf("[SESSION_FAILED] Bad response from [%s] - [%v]\n", u.String(), resp.Status)
queue.Drop()
Expand Down

0 comments on commit 34db1a4

Please sign in to comment.