{"action":"created","issue":{"url":"https://api.github.com/repos/ashleysommer/sanic-cors/issues/24","repository_url":"https://api.github.com/repos/ashleysommer/sanic-cors","labels_url":"https://api.github.com/repos/ashleysommer/sanic-cors/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/ashleysommer/sanic-cors/issues/24/comments","events_url":"https://api.github.com/repos/ashleysommer/sanic-cors/issues/24/events","html_url":"https://github.com/ashleysommer/sanic-cors/issues/24","id":358492639,"node_id":"MDU6SXNzdWUzNTg0OTI2Mzk=","number":24,"title":"Once add `automatic_options=True`, the header of response will generate duplicate properties","user":{"login":"dcalsky","id":9463958,"node_id":"MDQ6VXNlcjk0NjM5NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/9463958?v=4","gravatar_id":"","url":"https://api.github.com/users/dcalsky","html_url":"https://github.com/dcalsky","followers_url":"https://api.github.com/users/dcalsky/followers","following_url":"https://api.github.com/users/dcalsky/following{/other_user}","gists_url":"https://api.github.com/users/dcalsky/gists{/gist_id}","starred_url":"https://api.github.com/users/dcalsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcalsky/subscriptions","organizations_url":"https://api.github.com/users/dcalsky/orgs","repos_url":"https://api.github.com/users/dcalsky/repos","events_url":"https://api.github.com/users/dcalsky/events{/privacy}","received_events_url":"https://api.github.com/users/dcalsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-10T07:01:53Z","updated_at":"2018-09-13T10:42:48Z","closed_at":null,"author_association":"NONE","body":"Should : Access-Control-Allow-Origin →http://example.com\r\n\r\nActual: Access-Control-Allow-Origin →http://example.com, http://example.com "},"comment":{"url":"https://api.github.com/repos/ashleysommer/sanic-cors/issues/comments/420963772","html_url":"https://github.com/ashleysommer/sanic-cors/issues/24#issuecomment-420963772","issue_url":"https://api.github.com/repos/ashleysommer/sanic-cors/issues/24","id":420963772,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDk2Mzc3Mg==","user":{"login":"1mh0","id":167055,"node_id":"MDQ6VXNlcjE2NzA1NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/167055?v=4","gravatar_id":"","url":"https://api.github.com/users/1mh0","html_url":"https://github.com/1mh0","followers_url":"https://api.github.com/users/1mh0/followers","following_url":"https://api.github.com/users/1mh0/following{/other_user}","gists_url":"https://api.github.com/users/1mh0/gists{/gist_id}","starred_url":"https://api.github.com/users/1mh0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1mh0/subscriptions","organizations_url":"https://api.github.com/users/1mh0/orgs","repos_url":"https://api.github.com/users/1mh0/repos","events_url":"https://api.github.com/users/1mh0/events{/privacy}","received_events_url":"https://api.github.com/users/1mh0/received_events","type":"User","site_admin":false},"created_at":"2018-09-13T10:42:48Z","updated_at":"2018-09-13T10:42:48Z","author_association":"NONE","body":"Can confirm this issue, my virtualenv:\r\n```\r\nsanic==0.8.1\r\nSanic-Cors==0.9.5\r\nmultidict==4.4.0\r\n```\r\n\r\nAnd CORS extension should have `automatic_options=True`.\r\n\r\nFixed locally by changing this line:\r\nhttps://github.com/ashleysommer/sanic-cors/blob/master/sanic_cors/core.py#L256\r\n\r\nTo:\r\n```python\r\nresp.headers.update(headers_to_set)\r\n```\r\n\r\nSeems like **extend()** method will keep duplicate headers, only **update()** will overwrite them instead.\r\n\r\nI know that **extend()** according to documentation should overwrite existing keys... but it's not actually happening for some reason:\r\nhttps://multidict.readthedocs.io/en/stable/multidict.html#multidict.MultiDict.extend"}}
{"actor":{"display_login":"1mh0"}}