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]: updateHostURL() forces HTTPS for connections, affecting SetBaseURL(), SetAPIVersion(), etc #226

Closed
tjhop opened this issue Nov 16, 2021 · 1 comment · Fixed by #227

Comments

@tjhop
Copy link
Contributor

tjhop commented Nov 16, 2021

go Version

go version go1.17.2 darwin/amd64

API Wrapper Version

github.com/linode/linodego v1.2.0

Code Snippet

client := linodego.NewClient(nil)
client.SetBaseURL("http://api.notprod.linode.com") // this method calls c.updateHostURL(), which forcibly sets HTTPS on the URL

Expected Behavior

Base URL should be set to http://api.notprod.linode.com

Actual Behavior

Base URL is set to https://api.notprod.linode.com

Steps to Reproduce

  • Create clientt
  • Do anything that calls updateHostURL()
  • updateHostURL() calls the resty SetBaseURL on our behalf, forcing https
@tjhop tjhop added the bug label Nov 16, 2021
@tjhop
Copy link
Contributor Author

tjhop commented Nov 16, 2021

This breaks builds when manually constructing mock servers that use HTTP only (see failing builds on prometheus/prometheus#9763)

tjhop added a commit to tjhop/prometheus that referenced this issue Nov 16, 2021
This fixes failing builds when upgrading the linodego library:
prometheus#9763

*Note*: this requires `v1.2.1` of the linodego library to work

See also:
linode/linodego#226
linode/linodego#227
https://github.com/linode/linodego/releases/tag/v1.2.1

Signed-off-by: TJ Hoplock <[email protected]>
tjhop added a commit to tjhop/prometheus that referenced this issue Nov 16, 2021
This fixes failing builds due to the version bump of linodego to
`v1.2.1`.

Fixes:
prometheus#9763

See also:
linode/linodego#226
linode/linodego#227
https://github.com/linode/linodego/releases/tag/v1.2.1

Signed-off-by: TJ Hoplock <[email protected]>
tjhop added a commit to tjhop/prometheus that referenced this issue Nov 16, 2021
This fixes failing builds due to the version bump of linodego to
`v1.2.1`.

Fixes:
prometheus#9763

See also:
linode/linodego#226
linode/linodego#227
https://github.com/linode/linodego/releases/tag/v1.2.1

Signed-off-by: TJ Hoplock <[email protected]>
roidelapluie pushed a commit to prometheus/prometheus that referenced this issue Nov 16, 2021
* build(deps): bump github.com/linode/linodego from 1.1.0 to 1.2.1
* fix: linode SD tests

This fixes failing builds due to the version bump of linodego to
`v1.2.1`.

Fixes:
#9763

See also:
linode/linodego#226
linode/linodego#227
https://github.com/linode/linodego/releases/tag/v1.2.1

Signed-off-by: TJ Hoplock <[email protected]>
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 a pull request may close this issue.

1 participant