Skip to content
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

User-Agent header is sent only on requests to /api/server/version #459

Closed
valhristov opened this issue Mar 21, 2018 · 0 comments
Closed
Assignees
Milestone

Comments

@valhristov
Copy link
Contributor

valhristov commented 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

  • 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
@valhristov valhristov added this to the Near Future milestone Mar 21, 2018
@valhristov 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
@ghost ghost assigned michalb-sonar Apr 6, 2018
@ghost ghost added the Status: Needs Review label Apr 6, 2018
@ghost ghost removed the Status: Needs Review label Apr 6, 2018
@michalb-sonar michalb-sonar modified the milestones: Next, 4.2 Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants