Skip to content

Commit

Permalink
follow redirects until success (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcajmagic authored Dec 2, 2020
1 parent 86d2410 commit 1540303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.2.1]
- follow redirects until success [#33](https://github.com/xmidt-org/kratos/pull/33)

## [v0.2.0]
- Major refactor [#24](https://github.com/xmidt-org/kratos/pull/24)
- Connection resiliency fixes [#28](https://github.com/xmidt-org/kratos/pull/28)
Expand All @@ -19,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- The first official release. We will be better about documenting changes
moving forward.

[Unreleased]: https://github.com/xmidt-org/kratos/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/xmidt-org/kratos/compare/v0.2.1...HEAD
[v0.2.1]: https://github.com/xmidt-org/kratos/compare/v0.2.0...v0.2.1
[v0.2.0]: https://github.com/xmidt-org/kratos/compare/v0.1.0...v0.2.0
[v0.1.0]: https://github.com/xmidt-org/kratos/compare/444a84c5bf3074f9a9eb16081273fd5bd8cb5ddb...v0.1.0
2 changes: 1 addition & 1 deletion clientConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func createConnection(headerInfo *clientHeader, httpURL string) (connection *web
// creates a new client connection given the URL string
connection, resp, err := websocket.DefaultDialer.Dial(wsURL, headers)

if err == websocket.ErrBadHandshake && resp.StatusCode == http.StatusTemporaryRedirect {
for ;err == websocket.ErrBadHandshake && resp != nil && resp.StatusCode == http.StatusTemporaryRedirect; {
// Get url to which we are redirected and reconfigure it
wsURL = strings.Replace(resp.Header.Get("Location"), "http", "ws", 1)

Expand Down

0 comments on commit 1540303

Please sign in to comment.