mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
udpate oreo for request replays
This commit is contained in:
Generated
+1
-1
@@ -21,7 +21,7 @@ imports:
|
||||
- name: github.com/coryb/kingpeon
|
||||
version: 9b3d033f8a17e6b66af6123ec776bd93c19234cb
|
||||
- name: github.com/coryb/oreo
|
||||
version: b59de1c7ff7fe9e084278487f69a07cb667de9b3
|
||||
version: 95687d61c95ee1522c1140e2af59b0c1846abfc1
|
||||
- name: github.com/fatih/camelcase
|
||||
version: f6a740d52f961c60348ebb109adde9f4635d7540
|
||||
- name: github.com/guelfey/go.dbus
|
||||
|
||||
+5
-9
@@ -195,14 +195,12 @@ func (c *Client) saveCookies(resp *http.Response) error {
|
||||
|
||||
cookies := resp.Cookies()
|
||||
for _, cookie := range cookies {
|
||||
if cookie.Domain == "" {
|
||||
// if it is host:port then we need to split off port
|
||||
parts := strings.Split(resp.Request.URL.Host, ":")
|
||||
host := parts[0]
|
||||
log.Debugf("Setting DOMAIN to %s for Cookie: %s", host, cookie)
|
||||
cookie.Domain = host
|
||||
}
|
||||
}
|
||||
|
||||
// expiry in one week from now
|
||||
expiry := time.Now().Add(24 * 7 * time.Hour)
|
||||
@@ -304,12 +302,13 @@ func (c *Client) Do(req *http.Request) (resp *http.Response, err error) {
|
||||
|
||||
// Callback may want to resubmit the request, so we
|
||||
// will need to rewind (Seek) the Reader back to start.
|
||||
var bodyCache []byte
|
||||
if len(c.postCallbacks) > 0 && !c.handlingPostCallback && req.Body != nil {
|
||||
bites, err := ioutil.ReadAll(req.Body)
|
||||
bodyCache, err = ioutil.ReadAll(req.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Body = ioutil.NopCloser(bytes.NewReader(bites))
|
||||
req.Body = ioutil.NopCloser(bytes.NewReader(bodyCache))
|
||||
}
|
||||
|
||||
log.Debugf("%s %s", req.Method, req.URL.String())
|
||||
@@ -345,11 +344,8 @@ func (c *Client) Do(req *http.Request) (resp *http.Response, err error) {
|
||||
}
|
||||
|
||||
if len(c.postCallbacks) > 0 && !c.handlingPostCallback {
|
||||
if req.Body != nil {
|
||||
rs, ok := req.Body.(io.ReadSeeker)
|
||||
if ok {
|
||||
rs.Seek(0, 0)
|
||||
}
|
||||
if len(bodyCache) > 0 {
|
||||
req.Body = ioutil.NopCloser(bytes.NewReader(bodyCache))
|
||||
}
|
||||
c.handlingPostCallback = true
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user