-
Notifications
You must be signed in to change notification settings - Fork 73
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
Follow HTTP redirects after failed WS dials #251
Conversation
This commit allows the opamp client to follow redirects after websocket handshake failures. Redirect following is not implemented by gorilla/websocket, but can be handled by inspecting the returned response object for 3xx status and Location header.
Thank you for the PR @echlebek |
@tigrannajaryan Thanks for taking a look, I've signed the CLA. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #251 +/- ##
==========================================
+ Coverage 73.45% 73.74% +0.28%
==========================================
Files 25 25
Lines 1537 1550 +13
==========================================
+ Hits 1129 1143 +14
+ Misses 298 297 -1
Partials 110 110 ☔ View full report in Codecov by Sentry. |
*Don't* test for missing schemes, they are not valid according to Request.Location(). Remove handling for missing schemes.
Coverage is now improved, with only one line missing coverage from the method. It would require a TLS server in test to cover it. Let me know if you think it's worthwhile. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, coverage looks good.
Just one comment remaining.
Thank you @echlebek ! |
This commit allows the opamp client to follow redirects after websocket handshake failures. Redirect following is not implemented by gorilla/websocket, but can be handled by inspecting the returned response object for 3xx status and Location header.
Closes #250