-
Notifications
You must be signed in to change notification settings - Fork 168
fix: set custom user-agent header to all HTTP requests #769
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
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🚀 Build artifacts are ready for testing!Download the wheel file and binaries with gh CLI or from the workflow artifacts. 📦 Install & RunPre-requisites# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and enter artifacts directory
mkdir artifacts && cd artifacts Quick Test with Python Package# Download and run with uv
gh run download 16224158297 -n dist -R pyupio/safety
uv run --with safety-3.6.0+feat.add.safety.user.agent-py3-none-any.whl safety --version Binary Installation# Linux
gh run download 16224158297 -n safety-linux -D linux -R pyupio/safety
cd linux && mv safety safety-pr && chmod +x safety-pr
# macOS
gh run download 16224158297 -n safety-macos -D macos -R pyupio/safety
cd macos && mv safety safety-pr && chmod +x safety-pr
# Windows
gh run download 16224158297 -n safety-windows -D windows -R pyupio/safety
cd windows && mv safety.exe safety-pr.exe
./safety-pr --version
|
All network requests from the Safety CLI now include a standardized user-agent header in the format: safety-cli/{version} ({os} {arch}; Python/{python_version}). This change enables Safety to distinguish requests coming from the CLI versus other sources when accessing the Safety Vulnerability Database (safety-db), providing better visibility into how the database is being consumed. The user-agent is centrally managed through the get_meta_http_headers() function to ensure consistency across all HTTP clients (requests and httpx).
a150473
to
6e9ee25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Nick. It looks good. Feel free to merge into the main branch.
All network requests from the Safety CLI now include a standardized user-agent header in the format: safety-cli/{version} ({os} {arch}; Python/{python_version}). This change enables Safety to distinguish requests coming from the CLI versus other sources when accessing the Safety Vulnerability Database (safety-db), providing better visibility into how the database is being consumed. The user-agent is centrally managed through the get_meta_http_headers() function to ensure consistency across all HTTP clients (requests and httpx).
Description
Type of Change
Related Issues
Testing
Checklist
Additional Notes