Skip to content

Whenever GitLab performs an HTTP request, include User-Agent header, as of RFC 7231, section 5.5.3.

Alex Karshin requested to merge akarshin/gitlab-ce:akarshin/issue-32912 into master

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

Performance and Testing

Edited by Alex Karshin

Merge request reports