monitoring-plugins/plugins/tests
Sven Nierlein acbfbf3de6 check_curl: fix relative redirects on non-standard port
Having a webserver respond with a relative redirect as for ex. in `Location: /path/to.html`
check_curl would use the wrong standard http/https port instead
of crafting the absolute url using the given scheme/hostname and port.

Adding a new test case for this for check_http and check_curl. check_http did
it correct already, so no fix necessary there.

before:

    %>./check_curl -H 127.0.0.1 -p 50493 -f follow -u /redirect_rel -s redirected -vvv
    **** HEADER ****
    HTTP/1.1 302 Found
    ...
    Location: /redirect2

    ...
    * Seen redirect location /redirect2
    ** scheme: (null)
    ** host: (null)
    ** port: (null)
    ** path: /redirect2
    Redirection to http://127.0.0.1:80/redirect2

fixed:

    %>./check_curl -H 127.0.0.1 -p 50493 -f follow -u /redirect_rel -s redirected -vvv
    **** HEADER ****
    HTTP/1.1 302 Found
    ...
    Location: /redirect2

    ...
    * Seen redirect location /redirect2
    ** scheme: (null)
    ** host: (null)
    ** port: (null)
    ** path: /redirect2
    Redirection to http://127.0.0.1:50493/redirect2

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2024-07-30 17:13:03 +02:00
..
certs sslutils: use chain from client certificates 2022-01-30 12:25:56 +01:00
conf Add tests using custom snmp agent 2009-07-31 03:07:38 -04:00
var check_procs: add test for elapsed time 2021-11-01 13:35:11 +01:00
check_curl.t check_curl: fix relative redirects on non-standard port 2024-07-30 17:13:03 +02:00
check_http.t check_curl: fix relative redirects on non-standard port 2024-07-30 17:13:03 +02:00
check_nt.t Fixed crash from check_nt when -H unspecified or given multiple times (sf.net #2731755, debian #521097) 2009-05-01 11:16:37 +02:00
check_procs.t check_procs: add a test for the newly added -X option. 2023-03-21 11:49:08 +01:00
check_snmp.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_snmp_agent.pl Improve tests for check_snmp & multiply option 2022-12-22 12:54:51 +01:00