{"action":"closed","issue":{"url":"https://api.github.com/repos/jschneier/django-storages/issues/47","repository_url":"https://api.github.com/repos/jschneier/django-storages","labels_url":"https://api.github.com/repos/jschneier/django-storages/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/jschneier/django-storages/issues/47/comments","events_url":"https://api.github.com/repos/jschneier/django-storages/issues/47/events","html_url":"https://github.com/jschneier/django-storages/issues/47","id":70739736,"node_id":"MDU6SXNzdWU3MDczOTczNg==","number":47,"title":"Using str in AWS_HEADERS causes spaces to be escaped!","user":{"login":"ka7eh","id":4112646,"node_id":"MDQ6VXNlcjQxMTI2NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/4112646?v=4","gravatar_id":"","url":"https://api.github.com/users/ka7eh","html_url":"https://github.com/ka7eh","followers_url":"https://api.github.com/users/ka7eh/followers","following_url":"https://api.github.com/users/ka7eh/following{/other_user}","gists_url":"https://api.github.com/users/ka7eh/gists{/gist_id}","starred_url":"https://api.github.com/users/ka7eh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ka7eh/subscriptions","organizations_url":"https://api.github.com/users/ka7eh/orgs","repos_url":"https://api.github.com/users/ka7eh/repos","events_url":"https://api.github.com/users/ka7eh/events{/privacy}","received_events_url":"https://api.github.com/users/ka7eh/received_events","type":"User","site_admin":false},"labels":[{"id":161076983,"node_id":"MDU6TGFiZWwxNjEwNzY5ODM=","url":"https://api.github.com/repos/jschneier/django-storages/labels/s3boto","name":"s3boto","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-04-24T17:00:29Z","updated_at":"2018-09-06T16:40:21Z","closed_at":"2018-09-06T16:40:21Z","author_association":"NONE","body":"See: https://github.com/boto/boto/issues/2536\n\nIf I set <code>AWS_HEADERS</code> as\n<code>{'Cache-Control':  'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY)}</code> (notice spaces), it will render to <code>'max-age=604800,%20s-maxage=604800,%20must-revalidate'</code>.\nEncoding the string as bytestring solved my problem on Django 1.7.7 and python3, but I didn't do any thorough testing.\n\n<pre>\nAWS_HEADERS = {\n    'Cache-Control': str.encode(\n        'max-age=%d, s-maxage=%d, must-revalidate' % (\n        AWS_EXPIREY, AWS_EXPIREY))\n}\n</pre>\n"}}
{"actor":{"display_login":"jschneier"}}