{"action":"created","issue":{"url":"https://api.github.com/repos/plow-technologies/servant-auth/issues/16","repository_url":"https://api.github.com/repos/plow-technologies/servant-auth","labels_url":"https://api.github.com/repos/plow-technologies/servant-auth/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/plow-technologies/servant-auth/issues/16/comments","events_url":"https://api.github.com/repos/plow-technologies/servant-auth/issues/16/events","html_url":"https://github.com/plow-technologies/servant-auth/pull/16","id":191770796,"number":16,"title":"Sane AddSetCookie","user":{"login":"martyall","id":8641079,"avatar_url":"https://avatars.githubusercontent.com/u/8641079?v=3","gravatar_id":"","url":"https://api.github.com/users/martyall","html_url":"https://github.com/martyall","followers_url":"https://api.github.com/users/martyall/followers","following_url":"https://api.github.com/users/martyall/following{/other_user}","gists_url":"https://api.github.com/users/martyall/gists{/gist_id}","starred_url":"https://api.github.com/users/martyall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martyall/subscriptions","organizations_url":"https://api.github.com/users/martyall/orgs","repos_url":"https://api.github.com/users/martyall/repos","events_url":"https://api.github.com/users/martyall/events{/privacy}","received_events_url":"https://api.github.com/users/martyall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-25T22:26:34Z","updated_at":"2016-11-29T13:14:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/plow-technologies/servant-auth/pulls/16","html_url":"https://github.com/plow-technologies/servant-auth/pull/16","diff_url":"https://github.com/plow-technologies/servant-auth/pull/16.diff","patch_url":"https://github.com/plow-technologies/servant-auth/pull/16.patch"},"body":"The current implementation of `AddSetCookie` used `ByteString` headers and a builder to fold over a list of `SetCookie`s. As was noted in the comment, this was kind of a hack solution, but more importantly it didn't even work properly because the cookies should have been comma separated, not by new lines, and even then apparently some browsers only support distinct `Set-Cookie` headers. I was looking at [this issue ](https://github.com/haskell-servant/servant/issues/396) on the Servant repo and got inspired to do this. I've already tested it using Postman and it seems like it works just fine.\r\n\r\nSome parts are kind of ugly, namely the explicit `n ~ S (S Z)` constraint on the `HasServer` instance. Definitely open to suggestions, but hoping something like this is satisfactory."},"comment":{"url":"https://api.github.com/repos/plow-technologies/servant-auth/issues/comments/263566731","html_url":"https://github.com/plow-technologies/servant-auth/pull/16#issuecomment-263566731","issue_url":"https://api.github.com/repos/plow-technologies/servant-auth/issues/16","id":263566731,"user":{"login":"bts","id":5743,"avatar_url":"https://avatars.githubusercontent.com/u/5743?v=3","gravatar_id":"","url":"https://api.github.com/users/bts","html_url":"https://github.com/bts","followers_url":"https://api.github.com/users/bts/followers","following_url":"https://api.github.com/users/bts/following{/other_user}","gists_url":"https://api.github.com/users/bts/gists{/gist_id}","starred_url":"https://api.github.com/users/bts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bts/subscriptions","organizations_url":"https://api.github.com/users/bts/orgs","repos_url":"https://api.github.com/users/bts/repos","events_url":"https://api.github.com/users/bts/events{/privacy}","received_events_url":"https://api.github.com/users/bts/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T13:14:03Z","updated_at":"2016-11-29T13:14:03Z","body":"Unfortunately combining multiple `Set-Cookie`s by comma separating them has been deprecated via [RFC 6265](https://tools.ietf.org/html/rfc6265):\r\n\r\n```\r\nAn origin server can include multiple\r\nSet-Cookie header fields in a single response.  The presence of a\r\nCookie or a Set-Cookie header field does not preclude HTTP caches\r\nfrom storing and reusing a response.\r\n\r\nOrigin servers SHOULD NOT fold multiple Set-Cookie header fields into\r\na single header field.  The usual mechanism for folding HTTP headers\r\nfields (i.e., as defined in [RFC2616]) might change the semantics of\r\nthe Set-Cookie header field because the %x2C (\",\") character is used\r\nby Set-Cookie in a way that conflicts with such folding.\r\n```\r\n\r\nso we should keep them as multiple separate `Set-Cookie` headers."}}
{"actor":{"display_login":"bts"}}