Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #235 from Kami/url_parse_parse_query_string
Url parse parse query string
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require('helper') | ||
|
||
local url = require('url') | ||
|
||
local path = '/somepath?test=bar&ponies=foo' | ||
|
||
local parsed = url.parse(path) | ||
assert(parsed.pathname == '/somepath') | ||
assert(parsed.query == 'test=bar&ponies=foo') | ||
|
||
local parsed = url.parse(path, true) | ||
assert(parsed.pathname == '/somepath') | ||
assert(deep_equal(parsed.query, {test = 'bar', ponies = 'foo'})) |