We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here we have a URL with a port component (:8071) and a query string component (?token=xxx&type=http-bulk) but with the path component left out:
:8071
?token=xxx&type=http-bulk
local url = require "socket.url" local parsed = url.parse("https://listener-eu.logz.io:8071?token=xxx&type=http-bulk") print(require("inspect")(parsed))
Result:
{ authority = "listener-eu.logz.io:8071?token=xxx&type=http-bulk", host = "listener-eu.logz.io", port = "8071?token=xxx&type=http-bulk", scheme = "https" }
I feel like one of the following must be true (probably need to read through an RFC to know for sure):
ref: Kong/kong#11931
The text was updated successfully, but these errors were encountered:
At least trying with lpeg_patterns, it parses correctly:
uri_patts = require "lpeg_patterns.uri" uri_patts.uri:match("https://listener-eu.logz.io:8071?token=xxx&type=http-bulk")
host listener-eu.logz.io port 8071 scheme https query token=xxx&type=http-bulk
So I'm going to say it's indeed an issue with luasocket.
Sorry, something went wrong.
probably need to read through an RFC to know for sure
I read RFC3986-Syntax Components, which mentions that
The scheme and path components are required, though the path may be empty (no characters)
If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character.
https://listener-eu.logz.io:8042?token=xxx&type=http-bulk \___/ \______________________/ \______________________/ | | | scheme authority query
https://listener-eu.logz.io:8071?token=xxx&type=http-bulk matched
https://listener-eu.logz.io:8071?token=xxx&type=http-bulk
authority
Yes, this is evidently a bug. Even if the empty path was not valid the port can't have a query string in it!
Contributions welcome if anybody wants to jump in with a PR.
alerque
Successfully merging a pull request may close this issue.
Here we have a URL with a port component (
:8071
) and a query string component (?token=xxx&type=http-bulk
) but with the path component left out:Result:
I feel like one of the following must be true (probably need to read through an RFC to know for sure):
ref: Kong/kong#11931
The text was updated successfully, but these errors were encountered: