Whenever GitLab performs an HTTP request, include User-Agent header, as of RFC 7231, section 5.5.3.
What does this MR do?
This MR addresses issue 32912.
RFC 7231, section 5.5.3. User-Agent defines "User-Agent" as a header to be sent with every request. This Merge Request adds the "User-Agent" header to all requests, which have any hint of headers. If no headers are set for the request, setting "User-Agent" is skipped.
I never did Ruby before this Merge Request, therefore I might need additional help with code or tests. For now, I only added tests for webhook calls. I'll appreciate any help.
Does my code conflict with No Exceptional Flows rule in this case? I thought it's "easier to ask for forgiveness than for permission" and instead of multiple edge cases I went with one exception handler.
~"ready for review"
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by Alex Karshin