-
Notifications
You must be signed in to change notification settings - Fork 576
feat(stdlib): Handle proxy tunnels in httlib integration #5303
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
base: master
Are you sure you want to change the base?
Conversation
7c49a36 to
bf37a48
Compare
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Ai
Other
Bug Fixes 🐛Integrations
Litellm
Other
Documentation 📚
Internal Changes 🔧Release
Other
🤖 This preview updates automatically when you update the PR. |
sentry_sdk/integrations/stdlib.py
Outdated
| tunnel_port = getattr(self, "_tunnel_port", None) | ||
| if tunnel_port: | ||
| port = tunnel_port | ||
| # need to override default_port for correct url recording |
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.
I'd suggest changing the url recording logic instead.
Otherwise, looks good to me!
79535e6 to
ea832e5
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
ea832e5 to
ae1326b
Compare
ae1326b to
d8e6104
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| else: | ||
| host = self.host | ||
| port = self.port | ||
|
|
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.
URL contains :None when tunnel port is unset
Medium Severity
When using a proxy tunnel without specifying a port (set_tunnel(host) or set_tunnel(host, None)), the _tunnel_port attribute is None. The expression port != default_port and ":%s" % port or "" incorrectly evaluates to ":None" because None != 80 is True, and ":%s" % None produces the truthy string ":None". This results in malformed URLs like http://api.example.com:None/foo in span descriptions and data, instead of the expected http://api.example.com/foo.
Issues