Skip to content

feat: include user-agent header in all API requets

Tomas Vik (OOO back on 2024-10-31) requested to merge 238-api-user-agent into main

This MR introduces the User-Agent header to all API requests. We already introduced this header for the new GraphQL GitLab service in #129 (closed). But this MR extracts the logic for building the header and uses it for all remaining API requests.

Header format

The format is following the syntax specification https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#Syntax

User-Agent: <product> / <product-version> <comment>

User-Agent: Mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions>

Our format: vs-code-gitlab-workflow/3.5.0 VSCode/1.50.1 Node.js/12.14.1 (darwin; x64)

where 3.5.0 represents package.json version attribute.

Testing

Production

In our production Kibana (the GraphQL service is now live):

Discover_-_Elastic

Kibana Link that works only for GitLab team members.

Local

In my local environment (using mitmproxy)

mitmproxy

Part of #238 (closed)

Edited by Tomas Vik (OOO back on 2024-10-31)

Merge request reports

Loading