include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for DNSCrypt-Proxy
-LUCI_DEPENDS:=+uclient-fetch +dnscrypt-proxy
+LUCI_DEPENDS:=+uclient-fetch +dnscrypt-proxy +luci-lib-httpprotoutils
LUCI_PKGARCH:=all
include ../../luci.mk
local fs = require("nixio.fs")
local uci = require("luci.model.uci").cursor()
local util = require("luci.util")
-local date = require("luci.http.protocol.date")
local res_input = "/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv"
local res_dir = fs.dirname(res_input)
local dump = util.ubus("network.interface", "dump", {})
local res_list = {}
local url = "https://raw.githubusercontent.com/dyne/dnscrypt-proxy/master/dnscrypt-resolvers.csv"
+local _, date = pcall(require, "luci.http.date")
+if not date then
+ _, date = pcall(require, "luci.http.protocol.date")
+end
+
if not fs.access(res_input) then
if not fs.access("/lib/libustream-ssl.so") then
m = SimpleForm("error", nil, translate("No default resolver list and no SSL support available.<br />")
include $(TOPDIR)/rules.mk
LUCI_TITLE:=HTTP(S) client library
-LUCI_DEPENDS:=+luci-base +luci-lib-nixio
+LUCI_DEPENDS:=+luci-base +luci-lib-nixio +luci-lib-httpprotoutils
include ../../luci.mk
local util = require "luci.util"
local table = require "table"
local http = require "luci.http"
-local date = require "luci.http.protocol.date"
+local date = require "luci.http.date"
local type, pairs, ipairs, tonumber = type, pairs, ipairs, tonumber
local unpack = unpack
--- /dev/null
+#
+# Copyright (C) 2018 The LuCI Team <luci@lists.subsignal.org>
+#
+# This is free software, licensed under the Apache License, Version 2.0 .
+#
+
+include $(TOPDIR)/rules.mk
+
+LUCI_TITLE:=HTTP protocol utility functions
+LUCI_DEPENDS:=+luci-base
+
+include ../../luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
-- This class provides basic ETag handling and implements most of the
-- conditional HTTP/1.1 headers specified in RFC2616 Sct. 14.24 - 14.28 .
-module("luci.http.protocol.conditionals", package.seeall)
+module("luci.http.conditionals", package.seeall)
-local date = require("luci.http.protocol.date")
+local date = require("luci.http.date")
function mk_etag( stat )
This class provides basic ETag handling and implements most of the
conditional HTTP/1.1 headers specified in RFC2616 Sct. 14.24 - 14.28 .
]]
-module "luci.http.protocol.conditionals"
+module "luci.http.conditionals"
---[[
Implement 14.19 / ETag.
-- Licensed to the public under the Apache License 2.0.
-- This class contains functions to parse, compare and format http dates.
-module("luci.http.protocol.date", package.seeall)
+module("luci.http.date", package.seeall)
require("luci.sys.zoneinfo")
This class contains functions to parse, compare and format http dates.
]]
-module "luci.http.protocol.date"
+module "luci.http.date"
---[[
Return the time offset in seconds between the UTC and given time zone.
-- This class provides functions to guess mime types from file extensions and
-- vice versa.
-module("luci.http.protocol.mime", package.seeall)
+module("luci.http.mime", package.seeall)
require("luci.util")
This class provides functions to guess mime types from file extensions and
vice versa.
]]
-module "luci.http.protocol.mime"
+module "luci.http.mime"
---[[
MIME mapping table containg extension - mimetype relations.