You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The /api/server/version is the first request made to SonarQube and SonarScanner.MSBuild.exe sends all required headers with it. All subsequent requests do not send all headers, including User-Agent.
The reason for the problem is that WebClient is clearing the following headers after each request: Accept, Connection, Content-Type, Expect, Referer, User-Agent. We need to set them before each request, not only the first time WebClient is created.
Repro steps
Setup the HTTP traffic capture.
Execute SonarScanner.MSBuild.exe begin
The HTTP traffic shows that UserAgent header is sent only on the /api/server/version request.
Expected behavior
User-Agent is sent with all requests.
Known workarounds
None.
Related information
Scanner for MSBuild Version 4.1
Usage: Any
The text was updated successfully, but these errors were encountered:
valhristov
changed the title
UserAgent header is sent only on requests to /api/server/version
User-Agent header is sent only on requests to /api/server/version
Mar 21, 2018
Description
The
/api/server/version
is the first request made to SonarQube and SonarScanner.MSBuild.exe sends all required headers with it. All subsequent requests do not send all headers, including User-Agent.The reason for the problem is that
WebClient
is clearing the following headers after each request: Accept, Connection, Content-Type, Expect, Referer, User-Agent. We need to set them before each request, not only the first time WebClient is created.Repro steps
SonarScanner.MSBuild.exe begin
/api/server/version
request.Expected behavior
User-Agent is sent with all requests.
Known workarounds
None.
Related information
The text was updated successfully, but these errors were encountered: