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

Fix MakeHTTPTransport #1065

Merged
merged 3 commits into from
Jan 25, 2022
Merged

Fix MakeHTTPTransport #1065

merged 3 commits into from
Jan 25, 2022

Conversation

ersonp
Copy link
Contributor

@ersonp ersonp commented Jan 19, 2022

Did you run make format && make check?

Fixes #

Changes:

How to test this PR:

  1. Checkout to #dmsg-149 in dmsg
  2. Uncomment replace github.com/skycoin/dmsg => ../dmsg in go.mod
  3. Run make dep && make build
  4. Generate dmsghttp config ./skywire-cli config gen -dirt
  5. Start visor ./skywire-visor -c skywire-config.json
  6. Check stream close logs on dmsg-server
  7. Shutdown the visor with Ctrl+C
  8. Check stream close logs on dmsg-server

Needs: #dmsg-149

This commit adds ctx to the MakeHTTPTransport func.
This commit fixes the func isNonceValid() in httpauth. The func isNonceValid() used to replace the original body of the response with the body from ioutil.NopCloser() which caused the res.Body.Close() to not work and so the stream in dmsghttp did not close.

Now instead of replacing the body of the response we instead create a new response var auxResp and send it back. Since it is a copy of the original response and not a pointer, the changes to the body of auxResp does not affect the original response.
@ersonp ersonp marked this pull request as ready for review January 24, 2022 05:40
This commit updates the dmsg@develop and fixes linting.
@jdknives jdknives merged commit 5693c6b into skycoin:develop Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants