Skip to content

fix: guard transport type assertion against non-standard DefaultTransport - #644

Merged
benrkia merged 1 commit into
mainfrom
ilbe/fix-transport-assertion-panic
Oct 1, 2026
Merged

benrkia merged 1 commit into
mainfrom
ilbe/fix-transport-assertion-panic

Conversation

@benrkia

@benrkia benrkia commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

#642

Description of changes:
Guard transport type assertion against non-standard DefaultTransport

newAPITransport asserted http.DefaultTransport to *http.Transport with an unchecked assertion. http.DefaultTransport is an http.RoundTripper, and instrumentation libraries such as otelhttp replace it with a wrapper that is not an *http.Transport, so the assertion panicked at client construction.

Fall back to a fresh *http.Transport when the default is not the standard transport. The API client only talks to the local Runtime and Extensions API, so it does not need to inherit any transport tuning from the wrapped default.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…port

newAPITransport asserted http.DefaultTransport to *http.Transport with an
unchecked assertion. http.DefaultTransport is an http.RoundTripper, and
instrumentation libraries such as otelhttp replace it with a wrapper that is
not an *http.Transport, so the assertion panicked at client construction.

Fall back to a fresh *http.Transport when the default is not the standard transport.
The API client only talks to the local Runtime and Extensions API, so it does not need
to inherit any transport tuning from the wrapped default.

Fixes: #642
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.99%. Comparing base (94b293d) to head (f99db80).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
+ Coverage   82.94%   82.99%   +0.04%     
==========================================
  Files          36       36              
  Lines        1425     1429       +4     
==========================================
+ Hits         1182     1186       +4     
  Misses        240      240              
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@darklight3it darklight3it left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🚀

@benrkia
benrkia merged commit 3fa202a into main Oct 1, 2026
13 checks passed
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.

4 participants