-
Notifications
You must be signed in to change notification settings - Fork 253
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
X-NuGet-Warning doesn't work when using proxy due to missing ServerWarningLogHandler #5004
Comments
Thanks for the bug report @zarenner . We will investigate this as soon as we can. |
Well over a year later, this is still an issue. |
And almost 6 years later, this is still an issue. I've been hit by this because a private feed I'm using emits the |
The proxy issue could be easily solved by setting the inner handler, just like it's done for the var innerHandler = messageHandler;
messageHandler = new ProxyAuthenticationHandler(clientHandler, HttpHandlerResourceV3.CredentialService?.Value, ProxyCache.Instance)
{
InnerHandler = innerHandler
}; instead of the current messageHandler = new ProxyAuthenticationHandler(clientHandler, HttpHandlerResourceV3.CredentialService?.Value, ProxyCache.Instance); For my particular private feed there was another issue that is not as easily solved: the
HTTP/1.1 302 Found
Server: nginx/1.18.0 (Ubuntu)
Date: Thu, 20 Jan 2023 08:48:36 GMT
Content-Length: 0
Connection: keep-alive
Location: /api/v3/packages/download/the.package/2.5.0/the.package.2.5.0.nupkg
X-NuGet-Warning: Package 'The.Package 3.0.0' cannot be downloaded because required subscription has expired. Redirecting to the latest available version: 2.5.0 |
Thank you @0xced for fixing the bug! The fix will be available in NuGet 6.7, VS 17.7, .NET SDK 7.0.400 |
The code that sets up ProxyAuthenticationHandler is missing ServerWarningLogHandler: https://github.com/NuGet/NuGet.Client/blob/7645448a1fbeff4bc17b9c74be115aa92c5b9b4a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpHandlerResourceV3Provider.cs#L55
As such, X-NuGet-Warning doesn't work when using a proxy (even fiddler).
The text was updated successfully, but these errors were encountered: