check_http fails when Transfer-Encoding is the last header

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_http fails when Transfer-Encoding is the last header

Postby leres » Wed Feb 22, 2017 10:30 pm

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.
Attachments
patch-plugins-check_http.c
patch for check_http.c
(533 Bytes) Downloaded 11 times
leres
 
Posts: 2
Joined: Wed Feb 22, 2017 10:16 pm

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

Postby mcapra » Thu Feb 23, 2017 11:30 am

Thanks for providing the patch! I've raised an issue on the github about this:
https://github.com/nagios-plugins/nagio ... issues/240
Be sure to check out our Knowledgebase for helpful articles and solutions!

https://github.com/mcapra/
User avatar
mcapra
Support Tech
 
Posts: 1940
Joined: Thu May 05, 2016 3:54 pm
Location: Nagios Enterprises

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

Postby leres » Thu Feb 23, 2017 12:20 pm

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.
leres
 
Posts: 2
Joined: Wed Feb 22, 2017 10:16 pm

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

Postby dwhitfield » Thu Feb 23, 2017 1:06 pm

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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 2084
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC


Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests