HaxeFoundation / HaxeFoundation/tora

First query-string parameter in url incorrectly parsed?

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
30
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.