Mageia Bugzilla – Attachment 12557 Details for
Bug 27976
ruby-em-http-request new security issue CVE-2020-13482
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Sample client for the upstream reproducer
client.rb (text/plain), 545 bytes, created by
Len Lawrence
on 2021-04-02 01:12:57 CEST
(
hide
)
Description:
Sample client for the upstream reproducer
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2021-04-02 01:12:57 CEST
Size:
545 bytes
patch
obsolete
>#!/usr/bin/ruby -W0 >require 'eventmachine' >require 'em-http' > >urls = ARGV >if urls.size < 1 > puts "Usage: #{$0} <url> <url> <...>" > exit >end > >pending = urls.size > >EM.run do > urls.each do |url| > http = EM::HttpRequest.new(url).get > http.callback { > puts "#{url}\n#{http.response_header.status} - #{http.response.length} bytes\n" > puts http.response > > pending -= 1 > EM.stop if pending < 1 > } > http.errback { > puts "#{url}\n" + http.error.to_s > > pending -= 1 > EM.stop if pending < 1 > } > end >end
#!/usr/bin/ruby -W0 require 'eventmachine' require 'em-http' urls = ARGV if urls.size < 1 puts "Usage: #{$0} <url> <url> <...>" exit end pending = urls.size EM.run do urls.each do |url| http = EM::HttpRequest.new(url).get http.callback { puts "#{url}\n#{http.response_header.status} - #{http.response.length} bytes\n" puts http.response pending -= 1 EM.stop if pending < 1 } http.errback { puts "#{url}\n" + http.error.to_s pending -= 1 EM.stop if pending < 1 } end end
View Attachment As Raw
Actions:
View
Attachments on
bug 27976
:
12556
| 12557