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: set default transport when caller provides uninitialized one #179

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Jun 13, 2022

When caller uses

kong.NewClient(<URL>, kong.HTTPClientWithHeaders(&http.Client{}, <HEADERS>))

where the http.Client's transport is uninitialized then issuing a request will cause a panic.

This PR addresses that by setting the transport to http.DefaultTransport whenever the caller provided the client but didn't set the transport.

@pmalek pmalek self-assigned this Jun 13, 2022
@pmalek pmalek marked this pull request as ready for review June 13, 2022 09:26
@pmalek pmalek requested a review from a team as a code owner June 13, 2022 09:26
@pmalek pmalek added the go Pull requests that update Go code label Jun 13, 2022
@pmalek pmalek linked an issue Jun 13, 2022 that may be closed by this pull request
@pmalek pmalek merged commit 6a93e60 into main Jun 13, 2022
@pmalek pmalek deleted the fix-no-transport-panic branch June 13, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connecting to Kong with kong-admin-token
3 participants