1

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?

pwas
  • 3,225
  • 18
  • 40

2 Answers2

4

I just had the same error 411 (Length required), and my problem was that I set -src https://nuget.org but this is wrong, it needs to be -src https://www.nuget.org.

Kenneth
  • 718
  • 1
  • 5
  • 7
3

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.

Sebas
  • 21,192
  • 9
  • 55
  • 109
  • Indeed, after investigating requests with Wireshark it turned out that proxy was cutting of some request's data like part do header. Don't know why, but changing to another proxy helped. – pwas Nov 03 '17 at 23:00