{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/takes/issues/314","labels_url":"https://api.github.com/repos/yegor256/takes/issues/314/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/314/comments","events_url":"https://api.github.com/repos/yegor256/takes/issues/314/events","html_url":"https://github.com/yegor256/takes/pull/314","id":80509293,"number":314,"title":"Made RsWithCookie able to combine the given value with previous ones. #293","user":{"login":"Bertram25","id":765917,"avatar_url":"https://avatars.githubusercontent.com/u/765917?v=3","gravatar_id":"","url":"https://api.github.com/users/Bertram25","html_url":"https://github.com/Bertram25","followers_url":"https://api.github.com/users/Bertram25/followers","following_url":"https://api.github.com/users/Bertram25/following{/other_user}","gists_url":"https://api.github.com/users/Bertram25/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertram25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertram25/subscriptions","organizations_url":"https://api.github.com/users/Bertram25/orgs","repos_url":"https://api.github.com/users/Bertram25/repos","events_url":"https://api.github.com/users/Bertram25/events{/privacy}","received_events_url":"https://api.github.com/users/Bertram25/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yegor256/takes/labels/15%20mins","name":"15 mins","color":"eb6421"},{"url":"https://api.github.com/repos/yegor256/takes/labels/@carlosmiranda","name":"@carlosmiranda","color":"009801"},{"url":"https://api.github.com/repos/yegor256/takes/labels/CR","name":"CR","color":"bfd4f3"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-25T11:47:22Z","updated_at":"2015-05-25T23:30:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yegor256/takes/pulls/314","html_url":"https://github.com/yegor256/takes/pull/314","diff_url":"https://github.com/yegor256/takes/pull/314.diff","patch_url":"https://github.com/yegor256/takes/pull/314.patch"},"body":"Also adapted the corresponding test."},"comment":{"url":"https://api.github.com/repos/yegor256/takes/issues/comments/105334300","html_url":"https://github.com/yegor256/takes/pull/314#issuecomment-105334300","issue_url":"https://api.github.com/repos/yegor256/takes/issues/314","id":105334300,"user":{"login":"Bertram25","id":765917,"avatar_url":"https://avatars.githubusercontent.com/u/765917?v=3","gravatar_id":"","url":"https://api.github.com/users/Bertram25","html_url":"https://github.com/Bertram25","followers_url":"https://api.github.com/users/Bertram25/followers","following_url":"https://api.github.com/users/Bertram25/following{/other_user}","gists_url":"https://api.github.com/users/Bertram25/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertram25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertram25/subscriptions","organizations_url":"https://api.github.com/users/Bertram25/orgs","repos_url":"https://api.github.com/users/Bertram25/repos","events_url":"https://api.github.com/users/Bertram25/events{/privacy}","received_events_url":"https://api.github.com/users/Bertram25/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T23:30:34Z","updated_at":"2015-05-25T23:30:34Z","body":"@carlosmiranda \r\n\r\nThanks for the review. :)\r\n\r\n> Let's simply call it previousValue.\r\nWe can pass String.format statement below on this line without reaching the line length limit.\r\nLet's keep this unit test as it is. Instead, add a second test \"addsMultipleCookies\" with the behavior we're specifically trying to implement.\r\n\r\nThose points should now be fixed:\r\n\r\n> Why are we swallowing an Exception here and then performing a return?\r\n\r\nAs for this point, I've been thinking about it, and I think you're right it is not the best thing to do.\r\nHere is the situation:\r\nres.head() can throw an IOException. And if I make previousValue() throw an Exception as well, then I'll end up being forced to make the RsWithCookie constuctor capable of throwing an exception.\r\nAs I didn't see that being done on any constructors in takes, I think this makes it pretty obvious this isn't the right thing to do.\r\nThus, if I want to make it use the exception correctly, I guess I'd have to create a new Response tye within the RsWithCookie class overriding the head() function and replacing the cookie header, with the cost that I will no more be able to use the Without/WithHeader decorations in that constructor.\r\n\r\nIf that's what desired, well, I'm back to square one but I can do it, the feature can also be seen in a more general point of view and maybe it is time to create a RsReplaceHeader class?\r\n\r\nJust tell me. :)\r\n\r\nBest regards,"}}