Skip to content

Commit

Permalink
Added HTTP host header to all requests so that it works with Python v…
Browse files Browse the repository at this point in the history
…ersions pre 2.6
  • Loading branch information
Ben Dowling committed May 18, 2010
1 parent 54cb8a0 commit 5586db6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fireeagle_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ def _build_server_url( self, info, role ):
return url

def fetch_response( self, http_method, url, \
body = None, headers = None ):
body = None, headers = {}):
"""Pass a request to the server and return the response as a string"""

# Explicity add a host header to prevent Python pre2.6 from adding the port
headers['host'] = API_SERVER
# Prepare the request
if ( body is not None ) or ( headers is not None ):
self.http_connection.request( http_method, url, body, headers )
Expand Down

0 comments on commit 5586db6

Please sign in to comment.