[#85940] [Ruby trunk Bug#14578] Forking a child process inside of a mutex crashes the ruby interpreter — ben.govero@...
Issue #14578 has been reported by bengovero (Ben Govero).
3 messages
2018/03/05
[#86205] [Ruby trunk Feature#14618] Add display width method to String for CLI — aycabta@...
Issue #14618 has been reported by aycabta (aycabta .).
3 messages
2018/03/19
[#86366] Re: [ruby-cvs:70102] usa:r63008 (trunk): get rid of test error/failure on Windows introduced at r62955 — Eric Wong <normalperson@...>
usa@ruby-lang.org wrote:
3 messages
2018/03/28
[ruby-core:86192] [Ruby trunk Bug#14615] Checking HTTP::Net response
From:
artur.beljajev@...
Date:
2018-03-18 22:42:12 UTC
List:
ruby-core #86192
Issue #14615 has been reported by artur86 (Artur Beljajev).
----------------------------------------
Bug #14615: Checking HTTP::Net response
https://bugs.ruby-lang.org/issues/14615
* Author: artur86 (Artur Beljajev)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Currently you need to either use `kind_of?` or `HTTPResponse#code` to find out the type of a response.
~~~ ruby
response = Net::HTTP.start(uri.hostname,
uri.port,
use_ssl: (uri.scheme == 'https'),
cert: OpenSSL::X509::Certificate.new(client_cert),
key: OpenSSL::PKey::RSA.new(client_key)) do |http|
http.request(request)
end
if response.code || response.kind_of?(Net::HTTPSuccess)
...
end
~~~
How about using data from either `Rack::Utils::SYMBOL_TO_STATUS_CODE` or `Net::HTTPResponse::CODE_TO_OBJ` to simply it to:
~~~
if response.ok?
...
end
in the same way as Rails does https://github.com/rails/rails/blob/2090615d39c071c9eb25e715275eb79f3f9b6266/actionpack/lib/action_dispatch/testing/assertions/response.rb#L22.
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>