diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-14 08:05:35 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-14 08:05:35 +0000 |
commit | f61896ae18d4d0c3fa20c957577a34e38d9d8aad (patch) | |
tree | b383b59a1a2761c5fa2110fdd7712e80f02d08ea /lib/net | |
parent | 90e4b4fb0c63cbf9ed6f170dc21ada7f5c8d6e92 (diff) | |
download | ruby-f61896ae18d4d0c3fa20c957577a34e38d9d8aad.tar.gz |
* ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz
* lib/drb/extservm.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/http/response.rb: ditto.
* lib/scanf.rb: ditto.
* lib/uri/generic.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/http.rb | 4 | ||||
-rw-r--r-- | lib/net/http/response.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index fa6185b0ba..70f5165e91 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1055,7 +1055,7 @@ module Net #:nodoc: # The address of the proxy server, if one is configured. def proxy_address if @proxy_from_env then - proxy_uri && proxy_uri.hostname + proxy_uri&.hostname else @proxy_address end @@ -1064,7 +1064,7 @@ module Net #:nodoc: # The port of the proxy server, if one is configured. def proxy_port if @proxy_from_env then - proxy_uri && proxy_uri.port + proxy_uri&.port else @proxy_port end diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index 126c22160d..f51d6b1373 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -251,7 +251,7 @@ class Net::HTTPResponse return yield @socket if self['content-range'] v = self['content-encoding'] - case v && v.downcase + case v&.downcase when 'deflate', 'gzip', 'x-gzip' then self.delete 'content-encoding' |