mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-11 09:40:05 -04:00
Revert "Re-structure the HTTP 1.1 headers to prevent 301s on servers with virtual hosts"
This reverts commit 2030 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2050 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
e8c7d1b3d1
commit
e9f976fbf3
3 changed files with 5 additions and 9 deletions
1
NEWS
1
NEWS
|
|
@ -9,7 +9,6 @@ This file documents the major additions and syntax changes between releases.
|
|||
check_procs now captures stderr in external command and adds to plugin output
|
||||
check_snmp now only prints perfdata for non numeric values (#1867716)
|
||||
check_icmp now supports packet size modification
|
||||
check_http now sends the Host header first to fix 301s on servers with vitrual hosts (Michael Harris).
|
||||
check_http -e now accepts a comma-delimited list of expected status codes
|
||||
libtap now included with this distribution for easier testing. Run ./configure with --enable-libtap
|
||||
|
||||
|
|
|
|||
|
|
@ -236,5 +236,4 @@ Jan Wagner
|
|||
Christian Schneemann
|
||||
Rob Windsor
|
||||
Hilko Bengen
|
||||
Michael Harris
|
||||
Sven Nierlein
|
||||
|
|
|
|||
|
|
@ -783,17 +783,15 @@ check_http (void)
|
|||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
/* If a hostname is provided, use HTTP/1.1 and send the hostname before the
|
||||
* Useragent. This fixes an issue with getting 301 responses from servers
|
||||
* with virtual hosts */
|
||||
if (host_name)
|
||||
asprintf (&buf, "%s %s HTTP/1.1\r\nHost: %s\r\n%s\r\n", http_method, server_url, host_name, user_agent);
|
||||
else
|
||||
asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent);
|
||||
asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent);
|
||||
|
||||
/* tell HTTP/1.1 servers not to keep the connection alive */
|
||||
asprintf (&buf, "%sConnection: close\r\n", buf);
|
||||
|
||||
/* optionally send the host header info */
|
||||
if (host_name)
|
||||
asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
|
||||
|
||||
/* optionally send any other header tag */
|
||||
if (http_opt_headers_count) {
|
||||
for (i = 0; i < http_opt_headers_count ; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue