tora icon indicating copy to clipboard operation
tora copied to clipboard

First query-string parameter in url incorrectly parsed?

Open rb1147x opened this issue 9 years ago • 0 comments

Hello,

It appears that neko.Web.getParamsString() incorrectly parses the first query-string parameter.

Given a URL: http://mywebsite.com/index.n?test=1&test2=323 the result shows below:

Hello from Tora!
Main.hx:9: {test2 => 323, q => /tora/test/index.ntest=1}

If this URL is used: http://mywebsite.com/index.n?&test=1&test2=323 (notice the & in front of the first query-string) the result shows correct:

Hello from Tora!
Main.hx:9: {test => 1, test2 => 323, q => /tora/test/index.n}

I don't think I've ever seen an initial & after the ?, but just to double check I referenced https://en.wikipedia.org/wiki/Query_string, which shows no need for a ? on the first query string.

The code used:

class Main {

    static function main() {

        Sys.println("Hello from Tora!");
        trace(neko.Web.getParamsString());

    }
}

Thanks!

rb1147x avatar Jul 18 '16 13:07 rb1147x