boto/boto — Issue #545: S3 generate_url() with response headers regression
Author: gtaylor
Created: 2012-02-02 17:55:42+00:00
State: open
Labels: Bug, S3

It looks like response headers no longer work in 2.2.1, whereas they did with boto 2.1.1. Here is what we're doing to reproduce this:

```python
import boto

conn = boto.connect_s3(aws_access_key_id='xxxxxxxxxxxxxx',
aws_secret_access_key='xxxxxxxxxxxxxxxxxxx')

key_name = 'series/doc03/mp3/doc03m3i01.mp3'

filename = 'biblical-concept-of-revelation-part.mp3'
disposition = 'attachment; filename="%s"' % filename
response_headers = {
'response-content-disposition': disposition,
}

print conn.generate_url(3600, 'GET',
bucket='ligonier-media',
key=key_name,
query_auth=True,
force_http=False,
# Commenting this out leads to the request succeeding.
response_headers=response_headers,
)
```

Basically, any time response headers are present, we get:

```

SignatureDoesNotMatch

The request signature we calculated does not match the signature you provided. Check your key and signing method.

47 45 54 0a 0a 0a 31 33 32 38 32 30 35 38 34 32 0a 2f 6c 69 67 6f 6e 69 65 72 2d 6d 65 64 69 61 2f 73 65 72 69 65 73 2f 64 6f 63 30 33 2f 6d 70 33 2f 64 6f 63 30 33 6d 33 69 30 31 2e 6d 70 33 3f 72 65 73 70 6f 6e 73 65 2d 63 6f 6e 74 65 6e 74 2d 64 69 73 70 6f 73 69 74 69 6f 6e 3d 61 74 74 61 63 68 6d 65 6e 74 3b 20 66 69 6c 65 6e 61 6d 65 3d 22 62 69 62 6c 69 63 61 6c 2d 63 6f 6e 63 65 70 74 2d 6f 66 2d 72 65 76 65 6c 61 74 69 6f 6e 2d 70 61 72 74 2e 6d 70 33 22

11E5E8DC4D46C0E9

d4Ft4t7k0ZGcaIT7afWzote1R0J3OreSJq2FupzSSWIU92uZPqmGyVsXU75y6PYm

O085Op8EG3mEqz2y+hT4zMQvRRw=

GET 1328205842 /ligonier-media/series/doc03/mp3/doc03m3i01.mp3?response-content-disposition=attachment; filename="biblical-concept-of-revelation-part.mp3"

xxxxxxxxxxxxxxxxx

```