Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Use email.utils.formatdate rather than strftime to create Date header…
Browse files Browse the repository at this point in the history
… to avoid problems with LOCALE. Closes GH-261.
  • Loading branch information
garnaat committed Jul 17, 2011
1 parent fde4785 commit 535a4e5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions boto/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
import boto.utils
import hmac
import sys
import time
import urllib
from email.utils import formatdate

from boto.auth_handler import AuthHandler
from boto.exception import BotoClientError
Expand Down Expand Up @@ -111,8 +111,7 @@ def add_auth(self, http_request, **kwargs):
method = http_request.method
auth_path = http_request.auth_path
if not headers.has_key('Date'):
headers['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT",
time.gmtime())
headers['Date'] = formatdate(usegmt=True)

c_string = boto.utils.canonical_string(method, auth_path, headers,
None, self._provider)
Expand All @@ -136,8 +135,7 @@ def __init__(self, host, config, provider):
def add_auth(self, http_request, **kwargs):
headers = http_request.headers
if not headers.has_key('Date'):
headers['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT",
time.gmtime())
headers['Date'] = formatdate(usegmt=True)

b64_hmac = self.sign_string(headers['Date'])
auth_hdr = self._provider.auth_header
Expand All @@ -157,8 +155,7 @@ def __init__(self, host, config, provider):
def add_auth(self, http_request, **kwargs):
headers = http_request.headers
if not headers.has_key('Date'):
headers['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT",
time.gmtime())
headers['Date'] = formatdate(usegmt=True)

b64_hmac = self.sign_string(headers['Date'])
s = "AWS3-HTTPS AWSAccessKeyId=%s," % self._provider.access_key
Expand Down

0 comments on commit 535a4e5

Please sign in to comment.