open-telemetry / opamp-go

OpAMP protocol implementation in Go
Apache License 2.0
146 stars 71 forks source link

Follow HTTP redirects after failed WS dials #251

Closed echlebek closed 8 months ago

echlebek commented 8 months ago

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

linux-foundation-easycla[bot] commented 8 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

tigrannajaryan commented 8 months ago

Thank you for the PR @echlebek Please sign the CLA.

echlebek commented 8 months ago

@tigrannajaryan Thanks for taking a look, I've signed the CLA.

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 73.74%. Comparing base (ce8a8dd) to head (f6cc5df).

Files Patch % Lines
client/wsclient.go 85.71% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

echlebek commented 8 months ago

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!

tigrannajaryan commented 8 months ago

Thank you @echlebek !