Skip to content

Commit

Permalink
Bugfixes in REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Jan 28, 2016
1 parent 4ccf76a commit 9f2e72c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions IM/REST.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ def get_media_type(header):
Function to get only the header media type
"""
accept = bottle.request.headers.get(header)
pos = accept.find(";")
if pos != -1:
accept = accept[:pos]
return accept.strip()
if accept:
pos = accept.find(";")
if pos != -1:
accept = accept[:pos]
return accept.strip()
else:
return accept

@app.route('/infrastructures/:id', method='DELETE')
def RESTDestroyInfrastructure(id=None):
Expand Down

0 comments on commit 9f2e72c

Please sign in to comment.