这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ascopes
Copy link
Contributor

@ascopes ascopes commented Jun 19, 2025

Addresses a logic error in internal/apiclient/httpclient.go that would only attempt to construct an ApigeeAPIClient with an HTTP proxy if the previous operation that attempts to parse the proxy URL failed.

This bug results in the API client singleton never being created when the proxy URL is valid, and the singleton is only created if the proxy is unset or has an invalid value. When using a proxy, this issue bubbles up and results in a nil-pointer dereference on the global API client singleton, which crashes the runtime.

Inverting the condition addresses this issue.

Can confirm proxies work as expected once this change is made.

Fixes GH-676.

Addresses a logic error in internal/apiclient/httpclient.go that would only attempt to 
construct an `ApigeeAPIClient` with an HTTP proxy if the previous operation
that attempts to parse the proxy URL failed.

This bug results in the API client singleton never being created when the proxy URL is valid,
and the singleton is only created if the proxy is unset or has an invalid value. When using a
proxy, this issue bubbles up and results in a nil-pointer dereference on the global
API client singleton, which crashes the runtime.

Inverting the condition addresses this issue.

Fixes apigeeGH-676.
Copy link
Collaborator

@kurtkanaskie kurtkanaskie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and Gemini ;)

@ssvaidyanathan ssvaidyanathan merged commit 2c5b846 into apigee:main Jun 23, 2025
2 checks passed
@ascopes ascopes deleted the bugfix/GH-676 branch June 24, 2025 12:27
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 this pull request may close these issues.

[BUG]: Setting a proxy causes apigeecli to segfault

3 participants