Skip to content
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

xavante loses url GET params #161

Open
d9k opened this issue Mar 29, 2018 · 2 comments
Open

xavante loses url GET params #161

d9k opened this issue Mar 29, 2018 · 2 comments

Comments

@d9k
Copy link

d9k commented Mar 29, 2018

example:

http://127.0.0.1:8083/test/url_params?a=1&b=2

a and b params are NOT in page.GET table.

For the case of

http://127.0.0.1:8083/test/url_params&a=1&b=2

a and b params appear in page.GET table (but this url is wrong!).

@d9k
Copy link
Author

d9k commented Mar 29, 2018

start-server.lua:

for http://127.0.0.1:8083/test/url_params?a=1&b=2:

in function(req,res,cap):

> req.parsed_url
{authority = "127.0.0.1:8083", host = "127.0.0.1", path = "/", port = "8083", query = "a=1&b=2", scheme = "http"} --[[table: 0x14ad6a0]]
> cap
{"test/url_params"}

@d9k
Copy link
Author

d9k commented Mar 29, 2018

so I patched start-server.lua:

at the end of function(req,res,cap):

                    req.cmd_url = "/index.lua?"..conf.route_parameter.."="..vars[1].."/"..get

                    if req.parsed_url.query then
                      req.cmd_url = req.cmd_url .. '&' .. req.parsed_url.query
                    end
                else
                    req.cmd_url = "/index.lua"
                end

                return "reparse"
            end

new lines are:

                    if req.parsed_url.query then
                      req.cmd_url = req.cmd_url .. '&' .. req.parsed_url.query
                    end

@d9k d9k changed the title xavante loses get url params xavante loses url GET params Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant