neturl
neturl copied to clipboard
URL and Query string parser, builder, normalizer for Lua
OpenResty Debian docker images now ship with OPM instead of LuaRocks. Would you consider publishing to OPM in addition moving forward?
This is a bit complicated, might want to not parse out the path components unless requested specifically, but I needed to get at the components so I just banged this...
Since the number of parameters in the query string can be high, it would be a good idea to parse them on demand (jit).
Url could use dot or nothing to specify sub level query string parameters, this should be possible.
Add a parameter to configure the maximum number of nested levels in the query string parameters. PHP has this set to 64 by default IIRC.
Add a configuration parameter to set the maximum number of parameters allowed in the query string
I am trying to migrate from another URL parser to this library. There are differences between that and this library with respect to the host-related values (specifically inclusion vs. exclusion...
```lua url = http://example.com//a/b/c neturl.parse(url):normalize() ``` Expected outcome ```lua -- url.host = example.com -- url.path = /a/b/c ``` Actual outcome ```lua -- url.host = a -- url.path = /b/c ```