From 25630b35e76ed78139195dc2f69dc0a5f188ab44 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Tue, 2 Apr 2013 23:34:44 +0900 Subject: [PATCH] Use case-when. --- lib/http/cookie.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/http/cookie.rb b/lib/http/cookie.rb index ebf96e7..ddb99ae 100644 --- a/lib/http/cookie.rb +++ b/lib/http/cookie.rb @@ -521,9 +521,10 @@ class HTTP::Cookie host = DomainName.new(uri.host) # RFC 6265 5.3 - return true if host.hostname == @domain - - if @for_domain # !host-only-flag + case + when host.hostname == @domain + true + when @for_domain # !host-only-flag host.cookie_domain?(@domain_name) else @domain.nil?