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

[BUG] Empty request body on refresh service token in makeRequest #77

Closed
shurwit opened this issue Nov 18, 2022 · 0 comments · Fixed by #78
Closed

[BUG] Empty request body on refresh service token in makeRequest #77

shurwit opened this issue Nov 18, 2022 · 0 comments · Fixed by #78
Assignees
Labels
bug Something isn't working

Comments

@shurwit
Copy link
Collaborator

shurwit commented Nov 18, 2022

Describe the bug
If the makeRequest function requires a refresh to occur, it will call client.Do on the same http.Request object twice. Each call will consume the body of teh request, so the second request will have an invalid empty body.

Expected behavior
The request should be identical before and after the refresh.

Additional Details
On receiving end, error shows as:

Error validating request" error="request body has an error: reading failed: unexpected EOF

@shurwit shurwit added the bug Something isn't working label Nov 18, 2022
@roberlander2 roberlander2 linked a pull request Nov 21, 2022 that will close this issue
18 tasks
shurwit pushed a commit that referenced this issue Nov 23, 2022
* fix request cloning, reset request body after access token refresh [#77]

* add max tokken refresh frequency error after second 401 [#77]

* update changelog

* fix bug trying to copy empty request bodies [#77]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants