Closed SinisterRectus closed 7 years ago
It was originally server
, but it makes more sense as isServer
. I made the change. As for setting the hostname, I'm assuming that it's been done right. Nothing broke on my end, so that's a plus.
I implemented this fix thinking that I was not touching any part of the public API; however, it seems that this PR would make secure-socket incompatible with older versions of coro-net. In other words, you would need to update to the latest coro-net to use the latest secure-socket. We'll have to carefully select version numbers this time, or I can adjust the fix to something non-breaking; something more like that which is proposed in #212.
We should probably just bump the major version on coro-net and secure-socket to be safe.
Looks good!
I'm also fine with the suggestion in #212, it's a less invasive change and should work as well right?
As discussed in IRC, I've restored backwards compatibility. Note that servername
should technically be hostname
, not host
. Luckily, coro-http
passes hostname
to coro-net as host
. This would only be a problem if anyone is using coro-net directly, and if they pass it an options table where host
is not the same as hostname
. We could add a fix for this with ssl:set('hostname', servername:match("^([^:/]+)"))
, but it seems like an edge case.
luvit/lit#212 luvit/luvit#986 luvit/luvit#987