Closed postmodern closed 4 months ago
We are using schemes as per:
irb(main):002> URI.scheme_list
=> {"WS"=>URI::WS, "WSS"=>URI::WSS, "HTTP"=>URI::HTTP, "HTTPS"=>URI::HTTPS, "LDAP"=>URI::LDAP, "FILE"=>URI::File, "FTP"=>URI::FTP, "MAILTO"=>URI::MailTo, "LDAPS"=>URI::LDAPS}
I actually think the style of keys in this list is wrong (why is it upper case?) and in addition, the listed schemes don't all make sense for async-http
. So I propose we have our own list of supported schemes?
I switched my code to using lowercase String values, which matches what URI::Generic.build()
accepts. Still, if you give it a Symbol, it should probably either be converted to a String or a TypeError
or ArgumentError
should be raised saying "unsupported scheme".
I've merged a fix for this. LMK if you think it's appropriate.
I noticed that that
Async::HTTP::Client
behaves oddly (ex: doesn't initialize a SSL connection and sends HTTP requests anyways) ifAsync::HTTP::Endpoint.for(...)
is given a Symbol URI scheme name instead of a String. I think there should be a.to_s
call on the givenscheme
or passed throughString()
to coerce it into a String value.Steps To Reproduce
Versions