From b4040aacb04ce38b7eae315d37b2a61a38aea4b1 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 18 Apr 2018 15:49:26 +0200 Subject: 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 --- .../luasrc/http/mime.luadoc | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 libs/luci-lib-httpprotoutils/luasrc/http/mime.luadoc (limited to 'libs/luci-lib-httpprotoutils/luasrc/http/mime.luadoc') diff --git a/libs/luci-lib-httpprotoutils/luasrc/http/mime.luadoc b/libs/luci-lib-httpprotoutils/luasrc/http/mime.luadoc new file mode 100644 index 0000000000..7751e2baf4 --- /dev/null +++ b/libs/luci-lib-httpprotoutils/luasrc/http/mime.luadoc @@ -0,0 +1,34 @@ +---[[ +LuCI http protocol implementation - mime helper class. + +This class provides functions to guess mime types from file extensions and +vice versa. +]] +module "luci.http.mime" + +---[[ +MIME mapping table containg extension - mimetype relations. + +@class table +]] + +---[[ +Extract extension from a filename and return corresponding mime-type or + +"application/octet-stream" if the extension is unknown. +@class function +@name to_mime +@param filename The filename for which the mime type is guessed +@return String containign the determined mime type +]] + +---[[ +Return corresponding extension for a given mime type or nil if the + +given mime-type is unknown. +@class function +@name to_ext +@param mimetype The mimetype to retrieve the extension from +@return String with the extension or nil for unknown type +]] + -- cgit v1.2.3