Skip to content

Commit

Permalink
add cookie for GS316 requests
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram509 committed Oct 16, 2024
1 parent 2d1c960 commit 8a0b28f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ func doHttpRequestAndReadResponse(args *GlobalOptions, httpMethod string, host s

if isModel30x(model) {
req.Header.Set("Cookie", "SID="+token)
} else if isModel316(model) {
req.Header.Set("Cookie", "gambitCookie="+token)
} else {
panic("model not supported")
}

client := &http.Client{}
Expand Down
2 changes: 1 addition & 1 deletion poe_cycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func (poe *PoeCyclePowerCommand) cyclePowerGs316EPx(args *GlobalOptions) error {
urlStr := fmt.Sprintf("http://%s/iss/specific/poePortConf.html", poe.Address)
reqForm := url.Values{}
reqForm.Add("TYPE", "resetPoe")
reqForm.Add("PoePort", createPortResetPayloadGs316EPx(poe.Ports))
reqForm.Add("Gambit", token)
reqForm.Add("PoePort", createPortResetPayloadGs316EPx(poe.Ports))
result, err := postPage(args, poe.Address, urlStr, reqForm.Encode())
if err != nil {
return err
Expand Down

0 comments on commit 8a0b28f

Please sign in to comment.