Page 1 of 1

check_http fails when Transfer-Encoding is the last header

Posted: Wed Feb 22, 2017 10:30 pm
by leres
After upgrading nagios-plugins from 2.1.4 to 2.2.0 check_http started failing for a couple of sites. This appears to be because there is no trailing \r\n after nTransfer-Encoding header which happens in the failing case to appear last:

Code: Select all

(gdb) set print elements 1024
(gdb) p header
$6 = 0x42b52c "Transfer-Encoding"
(gdb) p headers
$7 = 0x8020d5011 "Date: Thu, 23 Feb 2017 03:06:18 GMT\r\nStrict-Transport-Security: max-age=15768000\r\nExpires: Sun, 19 Nov 1978 05:00:00 GMT\r\nCache-Control: no-cache, must-revalidate\r\nContent-Language: en\r\nLink: <https://www.acceleratecarboncapture.org/>; rel=\"canonical\",<https://www.acceleratecarboncapture.org/>; rel=\"shortlink\"\r\nVary: Accept-Encoding\r\nConnection: close\r\nContent-Type: text/html; charset=utf-8\r\nX-Content-Type-Options: nosniff\r\nX-Frame-Options: SAMEORIGIN\r\nX-Xss-Protection: 1; mode=block\r\nX-Permitted-Cross-Domain-Policies: none\r\nSet-Cookie: TS01c5dffe=0194455fd2f7d13d0dfd3639e913c5be72ad765210444da57e54b28afad4297a495a503548292359a02c479837c2471e44fb798fbd; Path=/\r\nTransfer-Encoding: chunked"
The attached patch is one way to solve this.

Re: check_http fails when Transfer-Encoding is the last head

Posted: Thu Feb 23, 2017 11:30 am
by mcapra
Thanks for providing the patch! I've raised an issue on the github about this:
https://github.com/nagios-plugins/nagio ... issues/240

Re: check_http fails when Transfer-Encoding is the last head

Posted: Thu Feb 23, 2017 12:20 pm
by leres
Thanks! I would have posted there directly but when I went looking for where to report bugs I started here:
https://nagios-plugins.org/support/
which references the support forums for reporting bugs and does not mention the github repo as far as I can see.

Re: check_http fails when Transfer-Encoding is the last head

Posted: Thu Feb 23, 2017 1:06 pm
by dwhitfield
So, my initial reaction was "That's because github isn't for support. :)" That's literally what I typed, along with "https://nagios-plugins.org/development/ does reference github."

But, I now see
The Nagios support forum is the preferred method of communication when reporting bugs
I will let the developers know about this. Thanks for letting us know about both issues!