/[suikacvs]/messaging/manakai/lib/Message/Header/HTTP.pm
Suika

Contents of /messaging/manakai/lib/Message/Header/HTTP.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Sat Aug 3 11:42:22 2002 UTC (22 years, 3 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +33 -13 lines
2002-08-03  Wakaba <w@suika.fam.cx>

	* HTTP.pm: Define Window-Target: field.

1 wakaba 1.1
2     =head1 NAME
3    
4     Message::Header::RFC822 --- Internet Messages -- Definition
5     for RFC822 Namespaces of Header Fields
6    
7     =cut
8    
9     require Message::Header::Default;
10     package Message::Header::HTTP;
11     use strict;
12     use vars qw($VERSION);
13 wakaba 1.5 $VERSION=do{my @r=(q$Revision: 1.4 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
14 wakaba 1.1
15     our %OPTION = %Message::Header::Default::OPTION;
16     $OPTION{namespace_uri} = 'urn:x-suika-fam-cx:msgpm:header:http';
17     $OPTION{namespace_phname} = 'x-http';
18     $OPTION{namespace_phname_goodcase} = 'X-HTTP';
19    
20     $OPTION{case_sensible} = 0;
21     $OPTION{to_be_goodcase} = \&Message::Header::Default::_goodcase;
22    
23 wakaba 1.4 $OPTION{field_sort} = {qw/alphabetic 1 good-practice 1/};
24     $OPTION{field_sort_good_practice_order} = {};
25     {
26     my $i = 1;
27     for (
28     qw/status/, ## CGI header
29     qw/man c-man opt c-opt ext c-ext
30     cache-control connection date pragma transfer-encoding upgrade trailer via
31 wakaba 1.5 keep-alive/, ## General-Headers
32 wakaba 1.4 qw/accept accept-charset accept-encoding accept-language
33     authorization expect from host
34     if-modified-since if-match if-none-match if-range if-unmodified-since
35     max-forwards proxy-authorization range referer te user-agent/, ## Request-Headers
36     qw/accept-ranges age location proxy-authenticate retry-after server vary
37 wakaba 1.5 warning www-authenticate alternates/, ## Response-Headers
38     qw/allow etag expires last-modified link window-target
39     mime-version derived-from base content-/, ## Entity-Headers
40 wakaba 1.4 ) {
41     $OPTION{field_sort_good_practice_order}->{$_} = $i++;
42     }
43     ## default = 999
44     $i = 1000;
45     for (qw/list- mime-version content- xref/) {
46     $OPTION{field_sort_good_practice_order}->{$_} = $i++;
47     }
48     }
49    
50 wakaba 1.1 $OPTION{goodcase} = {
51     'pics-label' => 'PICS-Label',
52     'message-id' => 'Message-ID',
53     'mime-version' => 'MIME-Version',
54     uri => 'URI',
55     };
56    
57     $OPTION{value_type} = {
58     ':default' => ['Message::Field::Unstructured'],
59 wakaba 1.5 status => ['Message::Field::Status'],
60 wakaba 1.1
61 wakaba 1.5 ## HTTP-Date / delta-second
62 wakaba 1.1 date => ['Message::Field::Date'],
63     expires => ['Message::Field::Date'],
64     'if-modified-since' => ['Message::Field::Date'],
65 wakaba 1.5 'if-unmodified-since' => ['Message::Field::Date'],
66 wakaba 1.1 'last-modified' => ['Message::Field::Date'],
67    
68     p3p => ['Message::Field::Params'],
69 wakaba 1.5 'window-target' => ['Message::Field::ValueParams'],
70 wakaba 1.1 'mime-version' => ['Message::Field::Numval'],
71 wakaba 1.5 from => ['Message::Field::Addresses'],
72 wakaba 1.1
73 wakaba 1.5 ## product
74 wakaba 1.1 server => ['Message::Field::UA'],
75     'user-agent' => ['Message::Field::UA'],
76    
77 wakaba 1.5 ## Comma Separated List
78 wakaba 1.1 link => ['Message::Field::CSV'],
79     uri => ['Message::Field::CSV'],
80 wakaba 1.5 man => ['Message::Field::CSV'],
81     opt => ['Message::Field::CSV'],
82 wakaba 1.1
83 wakaba 1.5 ## A URI
84     base => ['Message::Field::URI',{
85     -output_comment => 0,
86     -output_display_name => 0,
87     -value_pattern => 'URL:%s',
88     }],
89 wakaba 1.1 location => ['Message::Field::URI'],
90 wakaba 1.5 referer => ['Message::Field::URI',{
91     -allow_fragment => 0,
92     -output_angle_bracket => 0,
93     -use_comment => 0,
94     -use_display_name => 0,
95     }],
96     referrer => ['Message::Field::URI',{
97     -allow_fragment => 0,
98     -output_angle_bracket => 0,
99     -use_comment => 0,
100     -use_display_name => 0,
101     }],
102 wakaba 1.1 };
103    
104     $OPTION{uri_mailto_safe} = {
105     ':default' => 1,
106     };
107    
108     $OPTION{field}->{ext} = { ## RFC 2774
109     empty_body => 1,
110     };
111    
112     $Message::Header::NS_phname2uri{$OPTION{namespace_phname}} = $OPTION{namespace_uri};
113     $Message::Header::NS_uri2phpackage{$OPTION{namespace_uri}} = __PACKAGE__;
114    
115     package Message::Header::HTTP::C;
116     our %OPTION = %Message::Header::HTTP::OPTION;
117     $OPTION{namespace_uri} = 'urn:x-suika-fam-cx:msgpm:header:http:c';
118     $OPTION{namespace_phname} = 'x-http-c';
119     $OPTION{namespace_phname_goodcase} = 'X-HTTP-C';
120    
121     $Message::Header::NS_phname2uri{$OPTION{namespace_phname}} = $OPTION{namespace_uri};
122     $Message::Header::NS_uri2phpackage{$OPTION{namespace_uri}} = __PACKAGE__;
123    
124 wakaba 1.2 package Message::Header::HTTP::CCPP;
125     ## CC/PP exchange protocol <http://www.w3.org/TR/NOTE-CCPPexchange>
126     our %OPTION = %Message::Header::HTTP::OPTION;
127     $OPTION{namespace_uri} = 'http://www.w3.org/1999/06/24-CCPPexchange';
128 wakaba 1.3
129     $OPTION{use_ph_namespace} = 0;
130 wakaba 1.2 $OPTION{namespace_phname} = '';
131     $OPTION{namespace_phname_goodcase} = '';
132 wakaba 1.3
133 wakaba 1.2 $OPTION{value_type} = {
134     ':default' => ['Message::Field::Unstructured'],
135     ## *-Profile-Diff-(1*DIGIT): field (field-body = application/XML)
136     profile => ['Message::Field::CSV'],
137     'profile-warning' => ['Message::Field::CSV',{
138     -is_quoted_string => 0,
139     }],
140     };
141    
142     $Message::Header::NS_uri2package{ $OPTION{namespace_uri} } = __PACKAGE__;
143    
144 wakaba 1.1 =head1 LICENSE
145    
146     Copyright 2002 wakaba E<lt>w@suika.fam.cxE<gt>.
147    
148     This program is free software; you can redistribute it and/or modify
149     it under the terms of the GNU General Public License as published by
150     the Free Software Foundation; either version 2 of the License, or
151     (at your option) any later version.
152    
153     This program is distributed in the hope that it will be useful,
154     but WITHOUT ANY WARRANTY; without even the implied warranty of
155     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
156     GNU General Public License for more details.
157    
158     You should have received a copy of the GNU General Public License
159     along with this program; see the file COPYING. If not, write to
160     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
161     Boston, MA 02111-1307, USA.
162    
163     =head1 CHANGE
164    
165     See F<ChangeLog>.
166 wakaba 1.5 $Date: 2002/07/27 04:43:03 $
167 wakaba 1.1
168     =cut
169    
170     1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24