diff options
author | Sven Nierlein <sven@consol.de> | 2024-07-29 18:53:32 (GMT) |
---|---|---|
committer | Sven Nierlein <sven@nierlein.org> | 2024-07-30 15:13:03 (GMT) |
commit | acbfbf3de614f03ea5f9d3942558f1661fc202a4 (patch) | |
tree | c19efcc783679d7f6b3b5686d2111052f3882128 /gl/fcntl-safer.h | |
parent | 4ab154d5c3640d7f2cc3180d2f05ac688be7a11b (diff) | |
download | monitoring-plugins-acbfbf3de614f03ea5f9d3942558f1661fc202a4.tar.gz |
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>
Diffstat (limited to 'gl/fcntl-safer.h')
0 files changed, 0 insertions, 0 deletions