line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ************************************************************************* |
2
|
|
|
|
|
|
|
# Copyright (c) 2014-2015-2015, SUSE LLC |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Redistribution and use in source and binary forms, with or without |
7
|
|
|
|
|
|
|
# modification, are permitted provided that the following conditions are met: |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# 1. Redistributions of source code must retain the above copyright notice, |
10
|
|
|
|
|
|
|
# this list of conditions and the following disclaimer. |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright |
13
|
|
|
|
|
|
|
# notice, this list of conditions and the following disclaimer in the |
14
|
|
|
|
|
|
|
# documentation and/or other materials provided with the distribution. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
# 3. Neither the name of SUSE LLC nor the names of its contributors may be |
17
|
|
|
|
|
|
|
# used to endorse or promote products derived from this software without |
18
|
|
|
|
|
|
|
# specific prior written permission. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
21
|
|
|
|
|
|
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
22
|
|
|
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
23
|
|
|
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
24
|
|
|
|
|
|
|
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25
|
|
|
|
|
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26
|
|
|
|
|
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27
|
|
|
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28
|
|
|
|
|
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29
|
|
|
|
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30
|
|
|
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE. |
31
|
|
|
|
|
|
|
# ************************************************************************* |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# ------------------------------------------- |
34
|
|
|
|
|
|
|
# Web::MREST |
35
|
|
|
|
|
|
|
# ------------------------------------------- |
36
|
|
|
|
|
|
|
# |
37
|
|
|
|
|
|
|
# MREST_Config.pm |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
# WARNING: THIS FILE MAY CONTAIN PASSWORDS |
40
|
|
|
|
|
|
|
# (restrictive permissions may be warranted) |
41
|
|
|
|
|
|
|
# ------------------------------------------- |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# MREST_HOST |
45
|
|
|
|
|
|
|
# the hostname (vhost) where REST server will listen on a part |
46
|
|
|
|
|
|
|
set( 'MREST_HOST', 'localhost' ); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# MREST_PORT |
49
|
|
|
|
|
|
|
# the port where the REST server will listen |
50
|
|
|
|
|
|
|
set( 'MREST_PORT', 5000 ); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# MREST_LOG_FILE |
53
|
|
|
|
|
|
|
# full path of log file to log to (in the user's home directory) |
54
|
|
|
|
|
|
|
# If you don't want it in the user's home directory, specify an absolute |
55
|
|
|
|
|
|
|
# path. |
56
|
|
|
|
|
|
|
set( 'MREST_LOG_FILE', "mrest.log" ); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# MREST_LOG_FILE_RESET |
59
|
|
|
|
|
|
|
# should the logfile be deleted/wiped/unlinked/reset before each use |
60
|
|
|
|
|
|
|
set( 'MREST_LOG_FILE_RESET', 1 ); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# MREST_DOCUMENTATION_URI |
63
|
|
|
|
|
|
|
# used in the "help"/"default" resources |
64
|
|
|
|
|
|
|
set( 'MREST_DOCUMENTATION_URI', 'https://metacpan.org/pod/Web::MREST' ); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# MREST_REPORT_BUGS_TO |
67
|
|
|
|
|
|
|
# this should be an ordinary string like "bugs@dochazka.com" or |
68
|
|
|
|
|
|
|
# "http://bugs.dochazka.com" |
69
|
|
|
|
|
|
|
set( 'MREST_REPORT_BUGS_TO', 'bug-App-MREST@rt.cpan.org' ); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# MREST_MAX_LENGTH_URI |
72
|
|
|
|
|
|
|
# maximum length of a URI in bytes -- see Resource.pm->uri_too_long |
73
|
|
|
|
|
|
|
set( 'MREST_MAX_LENGTH_URI', 1000 ); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# MREST_MAX_LENGTH_REQUEST_ENTITY |
76
|
|
|
|
|
|
|
# maximum length of request entity in bytes -- see Resource.pm->malformed |
77
|
|
|
|
|
|
|
set( 'MREST_MAX_LENGTH_REQUEST_ENTITY', 10000 ); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# MREST_APPNAME |
80
|
|
|
|
|
|
|
# name of application (for logging) -- this can be set to any string, with |
81
|
|
|
|
|
|
|
# the proviso that it should not contain ':' characters |
82
|
|
|
|
|
|
|
set( 'MREST_APPNAME', 'Web-MREST' ); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
# MFILE_APPLICATION_MODULE |
85
|
|
|
|
|
|
|
# the 'version' method of this module is called to get the version |
86
|
|
|
|
|
|
|
# number returned by the 'version' resource |
87
|
|
|
|
|
|
|
set( 'MREST_APPLICATION_MODULE', 'Web::MREST' ); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# MREST_DEBUG_MODE |
90
|
|
|
|
|
|
|
# determines whether or not debug- and trace-level messages are logged |
91
|
|
|
|
|
|
|
set( 'MREST_DEBUG_MODE', 1 ); |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# MREST_SUPPORTED_HTTP_METHODS |
94
|
|
|
|
|
|
|
# list of supported HTTP methods returned by the 'known_methods' method |
95
|
|
|
|
|
|
|
# "HEAD" is omitted on purpose - see t/501-Not-Implemented.t |
96
|
|
|
|
|
|
|
set( 'MREST_SUPPORTED_HTTP_METHODS', [ qw( GET PUT POST DELETE TRACE CONNECT OPTIONS ) ] ); |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# MREST_VALID_CONTENT_HEADERS |
99
|
|
|
|
|
|
|
# list of valid content headers as per RFC2616 |
100
|
|
|
|
|
|
|
set( 'MREST_VALID_CONTENT_HEADERS', [ qw( |
101
|
|
|
|
|
|
|
Encoding Language Length Location MD5 Range Type |
102
|
|
|
|
|
|
|
) ] ); |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# MREST_SUPPORTED_CONTENT_TYPES |
105
|
|
|
|
|
|
|
# list of supported content types (major portions only!) |
106
|
|
|
|
|
|
|
set( 'MREST_SUPPORTED_CONTENT_TYPES', [ |
107
|
|
|
|
|
|
|
'application/json', |
108
|
|
|
|
|
|
|
] ); |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# MREST_CACHE_ENABLED |
111
|
|
|
|
|
|
|
# set to 0 to include response headers telling clients not to cache |
112
|
|
|
|
|
|
|
set( 'MREST_CACHE_ENABLED', 0 ); |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# MREST_CACHE_CONTROL_HEADER |
115
|
|
|
|
|
|
|
# value of 'Cache-Control' header used to disable caching |
116
|
|
|
|
|
|
|
set( 'MREST_CACHE_CONTROL_HEADER', 'no-cache, no-store, must-revalidate, private' ); |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# ----------------------------------- |
120
|
|
|
|
|
|
|
# DO NOT EDIT ANYTHING BELOW THIS LINE |
121
|
|
|
|
|
|
|
# ----------------------------------- |
122
|
22
|
|
|
22
|
|
853269
|
use strict; |
|
22
|
|
|
|
|
36
|
|
|
22
|
|
|
|
|
543
|
|
123
|
22
|
|
|
22
|
|
71
|
use warnings; |
|
22
|
|
|
|
|
24
|
|
|
22
|
|
|
|
|
590
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |