HTTP/Params.pm untested

filter: Statementstmt 0.0% 0 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 10 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
CRAP 2.0
1 #
2 # Parameters and defaults for the HTTP parser; no actual code here
3 #
4  
5 package IDS::DataSource::HTTP::Params;
6 $IDS::DataSource::HTTP::Params::VERSION = "1.0";
7  
8 require Exporter;
9 our @ISA = ("Exporter");
10 our @EXPORT = qw (%params %param_options);
11 our @EXPORT_OK = qw (%params %param_options);
12  
13 %params = (
14 # general parameters
15 # source # filled in by IDS::DataSource::HTTP::read_session,
16 # it is the source of data,
17 # used when producing error/warn msgs
18 "msg_fh" => undef, # Where warning messages go; nowhere if undef
19 "return_warnings" => 1, # Warnings are tokens
20 "print_warnings" => 0, # Print warning messages (to msg_fh)
21 "verbose" => 0, # Print extra information; larger means more
22
23 # what to return as tokens
24 "with_values" => 1, # whether to put values in the parsed http
25 "lc_only" => 1, # whether to map all of the http to lower case
26 "file_types_only" => 1, # return only file types, not names
27  
28 # various data validation options
29 "recognize_hostnames" => 1, # return simply if a hostname is valid or not
30 "recognize_ipaddr" => 1, # return simply if an addr is valid or not
31 "lookup_hosts" => 0, # lookup hosts and addrs to ensure DNS entries?
32 "recognize_dates" => 1, # return simply if a date is valid or not
33 "handle_PHPSESSID" => 1, # validate PHP Session ID to avoid hash
34 "handle_EntityTag" => 1, # validate Entity Tags to avoid hashes
35 "recognize_qvalues" => 1, # validate qvalue; otherwise, return value
36 "email_user_length_only" => 0, # only return the email address length,
37 # not value
38 );
39  
40 # for command-line argument processing with GetOpt::Long
41 %param_options = (
42 "values" => \$params{"with_values"},
43 "lc" => \$params{"lc_only"},
44 "file_types_only" => \$params{"file_types_only"},
45 "verbose=i" => \$params{"verbose"},
46 "return_warnings" => \$params{"return_warnings"},
47 "print_warnings" => \$params{"print_warnings"},
48 "recognize_hostnames" => \$params{"recognize_hostnames"},
49 "recognize_ipaddr" => \$params{"recognize_ipaddr"},
50 "lookup_hosts" => \$params{"lookup_hosts"},
51 "recognize_dates" => \$params{"recognize_dates"},
52 "handle_PHPSESSID" => \$params{"handle_PHPSESSID"},
53 "handle_EntityTag" => \$params{"handle_EntityTag"},
54 "recognize_qvalues" => \$params{"recognize_qvalues"},
55 "email_user_length_only" => \$params{"email_user_length_only"},
56 );
57  
58 =head1 AUTHOR INFORMATION
59  
60 Copyright 2005-2007, Kenneth Ingham. All rights reserved.
61  
62 This library is free software; you can redistribute it and/or modify
63 it under the same terms as Perl itself.
64  
65 Address bug reports and comments to: ids_test at i-pi.com. When sending
66 bug reports, please provide the versions of IDS::Test.pm, IDS::Algorithm.pm,
67 IDS::DataSource.pm, the version of Perl, and the name and version of the
68 operating system you are using. Since Kenneth is a PhD student, the
69 speed of the reponse depends on how the research is proceeding.
70  
71 =head1 BUGS
72  
73 Please report them.
74  
75 =head1 SEE ALSO
76  
77 L<IDS::Algorithm>, L<IDS::DataSource>
78  
79 =cut
80  
81 1;