Skip to content

Instantly share code, notes, and snippets.

@confact
Created June 21, 2018 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save confact/4c0ad952f67fe844f46aeaf2fbeec752 to your computer and use it in GitHub Desktop.
Save confact/4c0ad952f67fe844f46aeaf2fbeec752 to your computer and use it in GitHub Desktop.
how i added support for ICY in Ruby
Net::HTTPResponse.instance_eval do
attr_reader :socket
def read_status_line(sock)
str = sock.readline
m = /\A(?:HTTP|ICY)(?:\/(\d+\.\d+))?\s+(\d\d\d)(?:\s+(.*))?\z/in.match(str) || raise(Net::HTTPBadResponse, "wrong status line: #{str.dump}")
m.captures
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment