libs: move http.protocol.{date,mime,conditionals} to luci-lib-httpprotoutils
[project/luci.git] / libs / luci-lib-httpprotoutils / luasrc / http / mime.luadoc
1 ---[[
2 LuCI http protocol implementation - mime helper class.
3
4 This class provides functions to guess mime types from file extensions and
5 vice versa.
6 ]]
7 module "luci.http.mime"
8
9 ---[[
10 MIME mapping table containg extension - mimetype relations.
11
12 @class table
13 ]]
14
15 ---[[
16 Extract extension from a filename and return corresponding mime-type or
17
18 "application/octet-stream" if the extension is unknown.
19 @class function
20 @name to_mime
21 @param filename The filename for which the mime type is guessed
22 @return                 String containign the determined mime type
23 ]]
24
25 ---[[
26 Return corresponding extension for a given mime type or nil if the
27
28 given mime-type is unknown.
29 @class function
30 @name to_ext
31 @param mimetype The mimetype to retrieve the extension from
32 @return                 String with the extension or nil for unknown type
33 ]]
34