Skip to content

Commit f674bc6

Browse files
author
Rohan Suryawanshi
committed
AV-214769 TKG-29234 Refreshing the csrf token and session id in case of 419 errors.
1 parent cb11cb4 commit f674bc6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

go/session/avisession.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,12 @@ func (avisess *AviSession) restRequest(verb string, uri string, payload interfac
859859
return nil, err
860860
}
861861
retryReq = true
862-
} else if resp.StatusCode == 419 || (resp.StatusCode >= 500 && resp.StatusCode < 599) {
862+
} else if resp.StatusCode == 419 {
863+
avisess.collectCookiesFromResp(resp)
864+
resp.Body.Close()
865+
retryReq = true
866+
glog.Infof("Retrying url: %s; retry: %d due to Status Code %d", url, retry, resp.StatusCode)
867+
} else if resp.StatusCode >= 500 && resp.StatusCode < 599 {
863868
resp.Body.Close()
864869
retryReq = true
865870
glog.Infof("Retrying url: %s; retry: %d due to Status Code %d", url, retry, resp.StatusCode)

0 commit comments

Comments
 (0)