Skip to content

First query-string parameter in url incorrectly parsed? #11

@rb1147x

Description

@rb1147x

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions