Skip to content

Commit

Permalink
Fix some problems with the Content-Type header in the proxy. Fix #237
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Oct 10, 2016
1 parent 0591d18 commit 9cad459
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wirecloud/proxy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,13 @@ def do_request(self, request, url, method, workspace):
if cookie_header_content != '':
request_data['headers']['Cookie'] = cookie_header_content

# Workaround some problems with empty bodies
# Seems that Django or WSGI provides default values for the
# Content-Length and Content-Type headers, so we are not able to detect
# if the request provided them :(
if str(request_data['headers'].get('content-length', '0')).strip() == '0':
request_data['data'] = None
if 'content-type' in request_data['headers']:
del request_data['headers']['content-type']

# Open the request
try:
Expand Down

0 comments on commit 9cad459

Please sign in to comment.