sonar-scanner-msbuild icon indicating copy to clipboard operation
sonar-scanner-msbuild copied to clipboard

User Agent Header not Set

Open RedlineTriad opened this issue 2 years ago • 0 comments

The following line of code is wrong: https://github.com/SonarSource/sonar-scanner-msbuild/blob/290ed63dd6d85f5fd74b564b68d11f26565d7e3e/src/SonarScanner.MSBuild.PreProcessor/WebClientDownloader.cs#L54

HttpRequestHeader.UserAgent.ToString()

returns UserAgent the name of the enum variant.

However, the correct value of the header is User-Agent as seen here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent

This causes reverse proxies and other logic that cares about this value (such as different auth flows for scanners than users) to break. And is very annoying to debug because it's such a small error.

RedlineTriad avatar Jul 29 '22 12:07 RedlineTriad