Skip to content

Conversation

@merchantmoh-debug
Copy link

This PR adds a documentation comment to the NewClient function in github/github.go.

The comment warns users that passing a nil httpClient results in the use of a default http.Client which has no timeout. This can lead to resource exhaustion or "slowloris" style issues in production environments. It recommends providing a custom http.Client with an appropriate timeout.

This change aligns with security best practices (Sentinel) by making the default behavior's risks explicit without introducing breaking changes

google-labs-jules bot and others added 2 commits January 11, 2026 12:59
Adds a warning to the `NewClient` function documentation to inform developers that the default `http.Client` (created when passing `nil`) has no timeout, which can be a security risk in production environments.
…rovement-10999790790030565127

Add security warning to NewClient documentation
@google-cla
Copy link

google-cla bot commented Jan 11, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gmlewis gmlewis changed the title bclient-improvement docs: Clarify nil http.Client usage has no timeout Jan 11, 2026
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @merchantmoh-debug.
LGTM.
Merging.

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.44%. Comparing base (4456d12) to head (7409d8e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3910   +/-   ##
=======================================
  Coverage   92.44%   92.44%           
=======================================
  Files         203      203           
  Lines       14927    14927           
=======================================
  Hits        13799    13799           
  Misses        926      926           
  Partials      202      202           

☔ View full report in Codecov by Sentry.
📢 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.

@gmlewis
Copy link
Collaborator

gmlewis commented Jan 11, 2026

Sorry, I spoke too soon. I cannot merge this until the CLA is signed.
If you prefer to not sign the CLA, I will close the PR. Please let me know, @merchantmoh-debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants