-
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
{
"type": "application",
"platform": "node",
"source-directories": [
"src"
],
"gren-version": "0.5.3",
"dependencies": {
"direct": {
"gren-lang/core": "6.0.1",
"gren-lang/node": "5.0.3",
"gren-lang/url": "5.0.0"
},
"indirect": {}
}
}
When a request comes in, the parsed URL should look like this:
-- Url.fromString "http://localhost:4000/blog/123?q=0&r=1#tag"
Just { fragment = Just "tag", host = "localhost", path = "/blog/123", port_ = Just 4000, protocol = Http, query = Just "q=0&r=1" }However, the query attribute comes with an extra ?, making the related query parser fail.
{ fragment = Nothing, host = "localhost", path = "/blog/123", port_ = Just 4000, protocol = Http, query = Just "?q=0&r=1" }The problem seems to be here:
node/src/Gren/Kernel/HttpServer.js
Line 47 in db725ad
| __$urlQuery: url.search, |
In node, an extra char appear in the parsed output of query and hash:
> new URL("http://localhost:8080/blog/1?a=123&b=456#tag")
URL {
href: 'http://localhost:8080/blog/1?a=123&b=456#tag',
origin: 'http://localhost:8080',
protocol: 'http:',
username: '',
password: '',
host: 'localhost:8080',
hostname: 'localhost',
port: '8080',
pathname: '/blog/1',
search: '?a=123&b=456',
searchParams: URLSearchParams { 'a' => '123', 'b' => '456' },
hash: '#tag'
}I wanted to try a change locally, by pointing my gren-lang/node to a localfile, but couldn't compile. Is it possible to play with kernel code locally to experiment?
I think we should run url.search.slice(1) and url.hash.slice(1) to conform to the historical parse result.
Metadata
Metadata
Assignees
Labels
No labels