summaryrefslogtreecommitdiff
path: root/src/http/mime.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-10-08 20:30:28 +0200
committerHenrik Rydberg <rydberg@euromail.se>2011-10-08 20:30:28 +0200
commit5df79c53745fde5d6c3340a2979b1429cd5892c1 (patch)
tree1a81af141708b826e9c61e8a04019994fcca8298 /src/http/mime.h
Initial import of htcd system 1.0
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/http/mime.h')
-rw-r--r--src/http/mime.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/http/mime.h b/src/http/mime.h
new file mode 100644
index 0000000..85200cc
--- /dev/null
+++ b/src/http/mime.h
@@ -0,0 +1,99 @@
1/*************************************************************************
2 *
3 * HTCd - Copyright (C) 1998-2006 Henrik Rydberg
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef MIMEHTTPH
21#define MIMEHTTPH
22
23#include <mime/mime.h>
24#include <mt/dates.h>
25
26// Entity Headers
27const mstring allow_tag="Allow";
28const mstring accept_tag="Accept";
29const mstring accept_charset_tag="Accept-Charset";
30const mstring accept_enc_tag="Accept-Encoding";
31const mstring accept_lang_tag="Accept-Language";
32const mstring accept_range_tag="Accept-Ranges";
33const mstring cont_enc_tag="Content-Encoding";
34const mstring cont_lang_tag="Content-Language";
35const mstring cont_location_tag="Content-Location";
36const mstring cont_md5_tag="Content-MD5";
37const mstring cont_range_tag="Content-Range";
38const mstring expires_tag="Expires";
39const mstring lastmod_tag="Last-Modified";
40// General headers
41const mstring cache_tag="Cache-Control";
42const mstring connect_tag="Connection";
43const mstring date_tag="Date";
44const mstring pragma_tag="Pragma";
45const mstring trailer_tag="Trailer";
46const mstring trans_enc_tag="Transfer-Encoding";
47const mstring upgrade_tag="Upgrade";
48const mstring via_tag="Via";
49const mstring warning_tag="Warning";
50// Request headers
51const mstring auth_tag="Authorization";
52const mstring expect_tag="Expect";
53const mstring host_tag="Host";
54const mstring if_match_tag="If-Match";
55const mstring if_mod_tag="If-Modified-Since";
56const mstring if_none_tag="If-None-Match";
57const mstring if_range_tag="If-Range";
58const mstring if_unmod_tag="If-Unmodified-Since";
59const mstring max_forwards_tag="Max-Forwards";
60const mstring proxy_tag="Proxy-Authorization";
61const mstring range_tag="Range";
62const mstring referer_tag="Referer";
63const mstring te_tag="TE";
64const mstring user_agent_tag="User-Agent";
65const mstring cookie_tag="Cookie";
66// Response headers
67const mstring age_tag="Age";
68const mstring etag_tag="ETag";
69const mstring location_tag="Location";
70const mstring proxy_authent_tag="Proxy-Authenticate";
71const mstring retry_tag="Retry-After";
72const mstring server_tag="Server";
73const mstring vary_tag="Vary";
74const mstring authent_tag="WWW-Authenticate";
75const mstring set_cookie_tag="Set-Cookie";
76
77class HTTP : public Mime {
78public:
79 HTTP();
80 HTTP(const sref& msg) { Init(msg); }
81
82 mstring cache,connect,date,pragma;
83 mstring trailer,trans_enc,upgrade,via,warning;
84 mstring allow,cont_enc,cont_lang,cont_location;
85 mstring cont_md5,cont_range,expires,lastmod;
86 mstring accept,accept_charset,accept_enc,accept_lang,accept_range;
87
88 time_t idate;
89 void putHead(mstream& out) const;
90protected:
91 int Special(sref line);
92 int Handle(const sref& name,
93 const sref& rawval,
94 const sref& val,
95 const rrpile& opts);
96};
97
98#endif
99