Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug doesn't reveal cookies #260

Closed
matthewpoer opened this issue Aug 5, 2019 · 2 comments
Closed

Debug doesn't reveal cookies #260

matthewpoer opened this issue Aug 5, 2019 · 2 comments

Comments

@matthewpoer
Copy link
Contributor

Resty Debug doesn't reflect all of the cookies that are being used.

After using resty to make an API authorization, my API's server responds with a Set-Cookie: which Resty handles excellently. The presence of the new cookies is verified in the current client's cookie jar, e.g. the below has plenty of output, including the API's authorization token.

cient := resty.GetClient()
fmt.Printf("client.Cookies: %+v\n", client.Jar)

However, when using Debug mode with Resty, those cookies are not present in the next API call, making the output misleading as we are sending more to the server than the log would have me believe, e.g. note the HEADERS in the response log from the following.

restyResult, err = resty.
	SetDebug(true).
	SetHostURL(myURL).
	R().
	SetFormData(someData).
	Post(myURL)
RESTY 2019/08/05 09:50:23 
---------------------- REQUEST LOG -----------------------
POST  [REDACTED]
HOST   : [REDACTED]
HEADERS:
             Content-Type: application/x-www-form-urlencoded
               User-Agent: go-resty/1.12.0 (https://github.com/go-resty/resty)
BODY   :
[REDACTED]
----------------------------------------------------------
RESTY 2019/08/05 09:50:23 
---------------------- RESPONSE LOG -----------------------
STATUS          : 200 OK
RECEIVED AT     : 2019-08-05T09:50:23.89673-04:00
RESPONSE TIME   : 760.151846ms
HEADERS:
            [REDACTED]
BODY   :
[REDACTED]
@jeevatkm
Copy link
Member

jeevatkm commented Sep 7, 2019

@matthewpoer Thank you for reporting an issue and also submitting PR for the debug log.

@jeevatkm
Copy link
Member

This issue has been addressed via PR #261, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants