-
Notifications
You must be signed in to change notification settings - Fork 8.5k
DEV: Add a user agent to all HTTP requests that Discourse makes. #31555
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
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.
Approving as is, comment is food for thought / future refactors.
@pento found another place where we are hardcoding another user-agent format, for twitter oneboxes: discourse/lib/onebox/engine/twitter_status_onebox.rb Lines 18 to 20 in 0470d1e
|
β¨ What's This?
This change monkey-patches
Net::HTTPHeader
to add a defaultUser-Agent
header to all requests that Discourse makes.π Testing
You can use a HTTP echo service to test that the header is being set correctly. For example: