swift3: Requests without a Content-Type header fail to authenticate

Bug #746220 reported by Doug Weimer on 2011-03-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Undecided
Mike Barton

Bug Description

The canonical_string(req) function generates an incorrect string when the client does not pass the Content-Type header. According to the S3 documentation (http://docs.amazonwebservices.com/AmazonS3/latest/dev/), if the client request does not include a Content-Type header, it should be treated as an empty string when generating the canonicalized request for authentication. The canonical_string() function in swift3.py adds 'None' to the canonicalized request rather than an empty string.

This is a regression from the bexar version which creates a correct request when the client does not pass a Content-Type header.

Software Version:
Ubuntu LTS 10.04
Swift - swift-1.3_dev - trunk
Python Webob - python-webob_1.0-1~lucid2_all.deb from swift-core/ppa and swift-core/trunk

Test Case:
Run 's3test.py lb' with the attached s3test.py. The username, password, hostname, and port variables need to be set in the script.

Expected Results:
Authentication succeeds and the canonicalized request is:
GET

<DATESTAMP>
/

Actual Results:
Authentication fails because the canonicalized request is:
GET

None
<DATESTAMP>
/

Related branches

Doug Weimer (dweimer) wrote :
Mike Barton (redbo) on 2011-03-31
Changed in swift:
assignee: nobody → Mike Barton (redbo)
gholt (gholt) on 2011-03-31
Changed in swift:
status: New → Fix Committed
Doug Weimer (dweimer) wrote :

Thank you both for the quick fix.

Thierry Carrez (ttx) on 2011-04-15
Changed in swift:
milestone: none → 1.3.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments