Skip to content
This repository
Newer
Older
100644 101 lines (93 sloc) 4.56 kb
fccc6851 » MLstate
2011-06-21 Initial open-source release
1 %%%%%%%%%%%%%%%%%%%%%%% -*-erlang-*-
2
3 %
abe5893b » Aqua-Ye
2012-04-14 [enhance] Resource: extended Resource.http_general_header in order to…
4 % Copyright © 2011, 2012 MLstate
fccc6851 » MLstate
2011-06-21 Initial open-source release
5 %
6 % This file is part of OPA.
7 %
8 % OPA is free software: you can redistribute it and/or modify it under the
9 % terms of the GNU Affero General Public License, version 3, as published by
10 % the Free Software Foundation.
11 %
12 % OPA is distributed in the hope that it will be useful, but WITHOUT ANY
13 % WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 % FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
15 % more details.
16 %
17 % You should have received a copy of the GNU Affero General Public License
18 % along with OPA. If not, see <http://www.gnu.org/licenses/>.
19 %
20 %%% General headers %%%
21 %%%%%%%%%%%%%%%%%%%%%%%
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
22 -define Cache_Control str = "Cache-Control: "~ str "\r\n"
23 -define Connection str = "Connection: "~ str "\r\n"
24 -define Date str = "Date: "~ str "\r\n"
25 -define Pragma str = "Pragma: "~ str "\r\n"
26 -define Trailer str = "Trailer: "~ str "\r\n"
27 -define Transfer_Encoding str = "Transfer-Encoding: "~ str "\r\n"
28 -define Upgrade str = "Upgrade: "~ str "\r\n"
29 -define Via str = "Via: "~ str "\r\n"
30 -define Warning str = "Warning: "~ str "\r\n"
31 -define Allow str = "Allow: "~ str "\r\n"
fccc6851 » MLstate
2011-06-21 Initial open-source release
32
33 %%%%%%%%%%%%%%%%%%%%%%
34 %%% Entity headers %%%
35 %%%%%%%%%%%%%%%%%%%%%%
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
36 -define Content_Encoding str = "Content-Encoding: "~ str "\r\n"
37 -define Content_Language str = "Content-Language: "~ str "\r\n"
38 -define Content_Length (nb:int64) = "Content-Length: "~ nb "\r\n"
39 -define Content_Location str = "Content-Location: "~ str "\r\n"
40 -define Content_MD5 str = "Content-MD5: "~ str "\r\n"
41 -define Content_Range str = "Content-Range: "~ str "\r\n"
42 -define Content_Type (str,lst : string list) = "Content-Type: "~ !"\r\n" !";" str (";" !";" !"\r\n" string)* as lst "\r\n"
43 -define Content_Disposition (str,lst : string list) = "Content-Disposition: "~ !"\r\n" !";" str (";" !";" !"\r\n" string)* as lst "\r\n"
44 %-define Content_Disposition str = "Content-Disposition: "~ str "\r\n"
45 -define Expires str = "Expires: "~ str "\r\n"
46 -define Last_Modified str = "Last-Modified: "~ str "\r\n"
fccc6851 » MLstate
2011-06-21 Initial open-source release
47
48 %%%%%%%%%%%%%%%%%%%%%%%%
49 %%% Requests headers %%%
50 %%%%%%%%%%%%%%%%%%%%%%%%
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
51 -define Accept str = "Accept: "~ str "\r\n"
52 -define Accept_Charset str = "Accept-Charset: "~ str "\r\n"
53 -define Accept_Encoding str = "Accept-Encoding: "~ str "\r\n"
54 -define Accept_Language str = "Accept-Language: "~ str "\r\n"
55 -define Authorization str = "Authorization: "~ str "\r\n"
56 -define Expect str = "Expect: "~ str "\r\n"
57 -define From str = "From: "~ str "\r\n"
58 -define Host str = "Host: "~ str "\r\n"
59 -define If_Match str = "If-Match: "~ str "\r\n"
60 -define If_Modified_Since str = "If-Modified-Since: "~ str "\r\n"
61 -define If_None_Match str = "If-None-Match: "~ str "\r\n"
62 -define If_Range str = "If-Range: "~ str "\r\n"
63 -define If_Unmodified_Since str = "If-Unmodified-Since: "~ str "\r\n"
64 -define Keep_Alive (nb:int) = "Keep-Alive: "~ nb "\r\n"
65 -define Max_Forwards str = "Max-Forwards: "~ str "\r\n"
66 -define Proxy_Authorization str = "Proxy-Authorization: "~ str "\r\n"
67 -define ReqRange str = "ReqRange: "~ str "\r\n"
68 -define Referer str = "Referer: "~ str "\r\n"
69 -define TE str = "TE: "~ str "\r\n"
70 -define User_Agent str = "User-Agent: "~ str "\r\n"
71 -define X_Forwarded_For str = "X-Forwarded-For: "~ str "\r\n"
fccc6851 » MLstate
2011-06-21 Initial open-source release
72
73 %%%%%%%%%%%%%%%%%%%%%%%%
74 %%% Response headers %%%
75 %%%%%%%%%%%%%%%%%%%%%%%%
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
76 -define Accept_Ranges str = "Accept-Ranges: "~ str "\r\n"
77 -define Age str = "Age: "~ str "\r\n"
78 -define ETag str = "ETag: "~ str "\r\n"
79 -define Location str = "Location: "~ str "\r\n"
80 -define Proxy_Authenticate str = "Proxy-Authenticate: "~ str "\r\n"
81 -define Retry_After str = "Retry-After: "~ str "\r\n"
82 -define Server str = "Server: "~ str "\r\n"
83 -define Vary str = "Vary: "~ str "\r\n"
84 -define WWW_Authenticate str = "WWW-Authenticate: "~ str "\r\n"
fccc6851 » MLstate
2011-06-21 Initial open-source release
85
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87 %%% Uncategorised headers %%%
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
89 -define Set_Cookie str = "Set-Cookie: "~ str "\r\n" % (coded) server updates UA
90 -define Cookie str = "Cookie: "~ str "\r\n" % (coded) UA returns to server
fccc6851 » MLstate
2011-06-21 Initial open-source release
91 % (uncoded) server keeps internal id
92 -define MyCookie ((found:bool),ecid,ecstr,icid,icstr) =
93 "MyCookie: found=" found " " ecid "=" ecstr "; " icid "=" icstr "\r\n"
94
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
95 -define Set_Cookie2 str = "Set-Cookie2: "~ str "\r\n"
fccc6851 » MLstate
2011-06-21 Initial open-source release
96 %-define Cookie2 ver = "Cookie2: $Version=" "\""? ver "\""? "\r\n" % ho hum.
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
97 -define Cookie2 str = "Cookie2: "~ str "\r\n"
fccc6851 » MLstate
2011-06-21 Initial open-source release
98
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
99 -define Origin str = "Origin: "~ str "\r\n"
abca1973 » Aqua-Ye
2012-04-16 [fix] HttpServer: broke server request headers parsing
100
7f0d2d2d » BourgerieQuentin
2012-04-19 [fix] http server: Header parser should be case insensitive
101 -define Custom (name,value) = name ": "~ value "\r\n"
Something went wrong with that request. Please try again.