Created
June 21, 2018 22:14
-
-
Save confact/4c0ad952f67fe844f46aeaf2fbeec752 to your computer and use it in GitHub Desktop.
how i added support for ICY in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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