Search code examples
nugetnuget-server

Error 411 on pushing nuget package to Nuget.Server


I have successfully setup Nuget.Server from http://nugetserver.net. I can access http://localhost/ site and http://localhost/nuget/Packages. Unfortunately, every nuget push causes the following error:

Pushing Sample.1.1.0.nupkg to 'http://localhost/api/v2/package'...
  PUT http://localhost/api/v2/package/
  LengthRequired http://localhost/api/v2/package/ 33ms
Kod stanu odpowiedzi nie wskazuje powodzenia: 411 (Length Required).

It looks like nuget client is not setting Content-Length header so IIS is complaining. How can I solve this?


Solution

  • In my case it was because of being behind a proxy. The proxy would just not forward all the info. Once the proxy removed the server would accept put request normally.