-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheme-independent connection and redirection #268
Conversation
Oops. I just merged your older pull request for omitting the port number in the Host: header and now there is a conflict here. Can you resubmit? I never played with tls on Lua. How do we know if the host has a valid certificate? Is this all automatic? |
Thanks! It was expected, as I wasn't sure which would go first. Resolving now. |
…hemes, with caller-adjustable scheme-to-transport mappings (default "socket.http" and "ssl.https")
f313929
to
e587800
Compare
Resolved, tested, and ready.
It is. That's all done by LuaSec. Before this patch, you had to make a different call separately yourself if it was HTTPS ( This patch just makes it transparent and easy. Same call, same arguments, regardless of scheme.
My favorite part is that if you make an HTTP request and get redirected to an HTTPS URL, it just works. (The example HTTP request above got a 307 back and did exactly that, in fact.) Important: Please note that it does require the one line change in LuaSec PR 132 to expose the tcp() method there. Hopefully that'll get merged on that side soon. |
Scheme-independent connection and redirection
Still says it has a conflict here. :( |
That was weird. My local repo said it had already been merged, and this page said there was a conflict, and then it seemed to have sorted itself out. Thanks. |
Automatically handles upgrade redirects from HTTP to HTTPS using LuaSec, and allows both HTTP and HTTPS requests to be made using the single
http.request()
function. Requires only thetcp()
function to be exposed byssl.https
. Also provides a path for support of other schemes in the future. See also brunoos/luasec#132.