From eb27aa76f345601ea19493071990f8720cb2f33b Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 30 Jan 2022 11:28:58 +0100 Subject: [PATCH] Adding d/p/13_check_http_fix_superflous_crlf (Closes: #913142) --- .../patches/13_check_http_fix_superflous_crlf | 32 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 33 insertions(+) create mode 100644 debian/patches/13_check_http_fix_superflous_crlf diff --git a/debian/patches/13_check_http_fix_superflous_crlf b/debian/patches/13_check_http_fix_superflous_crlf new file mode 100644 index 0000000..f69d3bf --- /dev/null +++ b/debian/patches/13_check_http_fix_superflous_crlf @@ -0,0 +1,32 @@ +From 8543f8e2cd72cbdd3aa8469c86ead50824fd88a6 Mon Sep 17 00:00:00 2001 +From: rincewind +Date: Tue, 20 Apr 2021 12:15:27 +0200 +Subject: [PATCH] Remove superflous CRLF in HTTP-Requests in check_http + +--- + plugins/check_http.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/plugins/check_http.c b/plugins/check_http.c +index 0b712665a..676cf6445 100644 +--- a/plugins/check_http.c ++++ b/plugins/check_http.c +@@ -948,8 +948,7 @@ check_http (void) + } + asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf); + asprintf (&buf, "%sHost: %s\r\n", buf, host_name); +- /* we finished our request, send empty line with CRLF */ +- asprintf (&buf, "%s%s", buf, CRLF); ++ + if (verbose) printf ("%s\n", buf); + send(sd, buf, strlen (buf), 0); + buf[0]='\0'; +@@ -1050,7 +1049,7 @@ check_http (void) + } + + xasprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, (int)strlen (http_post_data)); +- xasprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); ++ xasprintf (&buf, "%s%s", buf, http_post_data); + } + else { + /* or just a newline so the server knows we're done with the request */ diff --git a/debian/patches/series b/debian/patches/series index 87d76c0..e185f85 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -4,3 +4,4 @@ 10_check_curl_header 11_check_icmp_source_ip 12_check_disk_fix_btrfs +13_check_http_fix_superflous_crlf