gholt / swauth

This is the historical location of Swauth; active development is now at https://github.com/openstack/swauth
45 stars 30 forks source link

Add Content-Length to PUT requests #44

Closed apoikos closed 11 years ago

apoikos commented 11 years ago

HTTP PUT requires a Content-Length header and many web servers (e.g. nginx) enforce this limitation. The management utilities swauth-add-{account,user} and also middleware.Swauth.handle_put_account do not specify Content-Length with PUT requests, which causes requests routed through nginx to fail.

Fix this by including a Content-Length of zero for all HTTP PUTs.

N.B.: This is not needed for requests performed via make_pre_authed_request().

gholt commented 11 years ago

Thanks!