Skip to content

Commit

Permalink
Merge pull request boto#201 from wkornewald/master
Browse files Browse the repository at this point in the history
Fixed App Engine support
  • Loading branch information
mfschwartz committed May 17, 2011
2 parents 9eb43e2 + 2fc75a3 commit b79602f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion boto/connection.py
Expand Up @@ -73,6 +73,9 @@
except ImportError:
pass

_SERVER_SOFTWARE = os.environ.get('SERVER_SOFTWARE', '')
ON_APP_ENGINE = _SERVER_SOFTWARE.startswith('Google App Engine/')

PORTS_BY_SECURITY = { True: 443, False: 80 }

DEFAULT_CA_CERTS_FILE = os.path.join(
Expand Down Expand Up @@ -326,7 +329,8 @@ def server_name(self, port=None):
# did the same when calculating the V2 signature. In 2.6
# (and higher!)
# it no longer does that. Hence, this kludge.
if sys.version[:3] in ('2.6', '2.7') and port == 443:
if ((ON_APP_ENGINE and sys.version[:3] == '2.5') or
sys.version[:3] in ('2.6', '2.7')) and port == 443:
signature_host = self.host
else:
signature_host = '%s:%d' % (self.host, port)
Expand Down

0 comments on commit b79602f

Please sign in to comment.