Commit graph

11 commits

Author SHA1 Message Date
Sven Roederer
8b8d83e42d luci-base: move some generic classes into a separate luci-base-libs package
The new package luci-base-libs provides the modules that not strictly relate
to the web-interface of luci. By separating these libs they can be used by
other packages without having to install the web-components.
This change was inspired by providing a shell-only interface for 4MB-flash
devices, by keeping as much code common with a full install.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
2020-07-19 20:14:22 +02:00
Jo-Philipp Wich
d87169c0f6 luci-lib-httpclient: accept scoped IPv6 addresses
Ref: https://github.com/openwrt/luci/issues/3380
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-09 17:36:05 +01:00
Jo-Philipp Wich
a692ca789a luci-lib-httpclient: prevent nil access with invalid IP address literals
Fixes: a54baf7be ("luci-lib-httpclient: revamp URL handling")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-11 09:17:50 +01:00
Jo-Philipp Wich
a54baf7be0 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>
2018-12-11 09:12:32 +01:00
Jo-Philipp Wich
b4040aacb0 libs: move http.protocol.{date,mime,conditionals} to luci-lib-httpprotoutils
Also adjust the dependencies of components depending on these classes and
flatten the namespace from luci.http.protocol.* to luci.http.*

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-18 16:21:27 +02:00
Jo-Philipp Wich
eb4571c6dc luci-base: fold luci.http.protocol into luci.http
With only the decoder routines remaining in luci.http.protocol, it makes no
sense to keep the low level protocol class around, so fold the remaining code
into the central luci.http class.

Also adjust the few direct users of luci.http.protocol accordingly.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-18 16:21:27 +02:00
Yuzo
3dbdff7096 add params support in options 2015-01-22 13:12:48 +08:00
Yuzo
b6d4f32dcc send Cookie in a single header line, follow browser behavior 2015-01-22 12:50:58 +08:00
Yuzo
c30cf9abd4 add sock::readall() to ensure the response body is complete 2015-01-22 11:34:00 +08:00
Jo-Philipp Wich
7a3493b1f7 Globally reduce copyright headers
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-16 23:38:38 +01:00
Jo-Philipp Wich
1bb4822dca Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names
 * Make each LuCI module its own standalone package
 * Deploy a shared luci.mk which is used by each module Makefile

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08 16:26:20 +01:00