-
Notifications
You must be signed in to change notification settings - Fork 136
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
Implements redirects #38
base: master
Are you sure you want to change the base?
Conversation
And will wel make backward compatibility? I think someone could create a third project that is aware of LuaSocket and LuaSec, with the "net tools". The "net tools" project could do a best work with http/s, imap/s, smpt/s, etc, without restrictions. Eventually, LuaSocket and LuaSec could remove these tools from the base and concentrate only in low-level communication. |
Yes.
That could work, but currently LuaSec builds on top of LuaSocket, LuaSocket does in no way depend on any other module. If these functions where extracted into a separate module, then that module would depend on both LuaSocket and LuaSec. So the current LuaSocket functionality would get an extra dependency on LuaSec in that scenario. So I don't see that happening. Especially considering the slow pace of development of LuaSocket. But -back to this PR- that also limits the chance of this PR ever getting merged, as it depends on a PR for LuaSocket as well. As such I included the full |
@Tieske Could you update this (and lunarmodules/luasocket#133 ) to current master? I'm having 301 troubles, strongly suspect that url rewrites are the cause (urls with ' and similar fail, others work fine; I don't see a difference between the originally requested url and the one in the 301 reply) and dearly hope this will resolve them... |
1)remove http2 folder. 2)add modified http.lua inside luasec 3) modify https.lua 4) add test.lua to check redirects working basically implemented suggestions from lunarmodules#38
lunarmodules/luasec#38 Implements redirects (.gitignore and luasec-0.5-3.rockspec ommitted)
Obviated by LuaSocket#268. |
Fixes #34, but depends on a PR for LuaSocket (lunarmodules/luasocket#133) to export more information.
With this PR the
https.request
method will work for bothhttp
andhttps
calls and allow redirects (also for changing schemes; http <-> https, in the redirect).By default it will not allow https -> http redirect, and fail with a security error in that case;
Unallowed insecure redirect https to http
. If theredirect
field in the request is set to"all"
, then the redirect https -> http will be allowed and executed.Some simple test code;