summaryrefslogtreecommitdiff
path: root/lib/net/http/header.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/http/header.rb')
-rw-r--r--lib/net/http/header.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb
index b704860c90..ec5552f04d 100644
--- a/lib/net/http/header.rb
+++ b/lib/net/http/header.rb
@@ -699,10 +699,14 @@ module Net::HTTPHeader
# res.content_type # => "application/json"
#
def content_type
- return nil unless main_type()
- if sub_type()
- then "#{main_type()}/#{sub_type()}"
- else main_type()
+ main = main_type()
+ return nil unless main
+
+ sub = sub_type()
+ if sub
+ "#{main}/#{sub}"
+ else
+ main
end
end