luci-lib-httpclient: revamp URL handling
authorJo-Philipp Wich <jo@mein.io>
Tue, 11 Dec 2018 07:57:36 +0000 (08:57 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 11 Dec 2018 08:12:32 +0000 (09:12 +0100)
commita54baf7be0d293b50c6b2754c11d61e6e2ad82af
tree8a3a800f4a05cce3fc4e249ea8d324f927cba163
parentb94be57affcbb8eeb7f2f6a3561ebeccaa40cf6f
luci-lib-httpclient: revamp URL handling

 - Introduce a parse_url() helper which properly deals with literal IPv4
   and IPv6 host parts and returns the decomposed uri string as table
 - Properly format IPv6 literals in autogenerated Host headers
 - Omit default port numbers in Host headers and calculated redirect URLs.

Supersedes PR #2337.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libs/luci-lib-httpclient/luasrc/httpclient.lua