summaryrefslogtreecommitdiffstats
path: root/web/attachments/49410-nagios-check_http-header-patch.txt
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/49410-nagios-check_http-header-patch.txt')
-rw-r--r--web/attachments/49410-nagios-check_http-header-patch.txt75
1 files changed, 75 insertions, 0 deletions
diff --git a/web/attachments/49410-nagios-check_http-header-patch.txt b/web/attachments/49410-nagios-check_http-header-patch.txt
new file mode 100644
index 0000000..c2d9556
--- /dev/null
+++ b/web/attachments/49410-nagios-check_http-header-patch.txt
@@ -0,0 +1,75 @@
1--- check_http.c 2003-05-02 18:28:50.000000000 -0500
2+++ check_http_orig.c 2003-02-22 01:22:02.000000000 -0600
3@@ -41,7 +41,7 @@
4 certificate expiration times.\n"
5
6 #define OPTIONS "\
7-(-H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>] [-E header]\n\
8+(-H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\
9 [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
10 [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
11 [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
12@@ -61,8 +61,6 @@
13 URL to GET or POST (default: /)\n\
14 -p, --port=INTEGER\n\
15 Port number (default: %d)\n\
16- -E, --extra-header=HEADER\n\
17- Extra HTTP header (name: value)\n\
18 -P, --post=STRING\n\
19 URL encoded http POST data\n\
20 -w, --warning=INTEGER\n\
21@@ -222,7 +220,6 @@
22 int sd;
23 char *http_method = "GET";
24 char *http_post_data = "";
25-char *http_extra_headers = NULL;
26 char buffer[MAX_INPUT_BUFFER];
27
28 void print_usage (void);
29@@ -305,7 +302,6 @@
30 {"nohtml", no_argument, 0, 'n'},
31 {"ssl", no_argument, 0, 'S'},
32 {"verbose", no_argument, 0, 'v'},
33- {"extra-header", required_argument, 0, 'E'},
34 {"post", required_argument, 0, 'P'},
35 {"IP-address", required_argument, 0, 'I'},
36 {"string", required_argument, 0, 's'},
37@@ -335,7 +331,7 @@
38 strcpy (argv[c], "-n");
39 }
40
41-#define OPTCHARS "Vvht:c:w:H:E:P:I:a:e:p:s:R:r:u:f:C:nlLS"
42+#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLS"
43
44 while (1) {
45 #ifdef HAVE_GETOPT_H
46@@ -434,17 +430,6 @@
47 strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1);
48 user_auth[MAX_INPUT_BUFFER - 1] = 0;
49 break;
50- case 'E': /* extra HTTP header as name: value */
51- if (strstr (optarg, ": ") == NULL)
52- usage2 ("invalid HTTP header syntax: should be of the form 'name: value'", optarg);
53- if (http_extra_headers == NULL) {
54- asprintf (&http_extra_headers, "%s\r\n", optarg);
55- } else {
56- char *old_headers = http_extra_headers;
57- asprintf (&http_extra_headers, "%s%s\r\n", old_headers, optarg);
58- free (old_headers);
59- }
60- break;
61 case 'P': /* HTTP POST data in URL encoded format */
62 asprintf (&http_method, "%s", "POST");
63 asprintf (&http_post_data, "%s", optarg);
64@@ -610,11 +595,6 @@
65 asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth);
66 }
67
68- /* send extra headers if requested */
69- if (http_extra_headers != NULL) {
70- asprintf (&buf, "%s%s", buf, http_extra_headers);
71- }
72-
73 /* either send http POST data */
74 if (strlen (http_post_data)) {
75 asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf);