content/http checks with interesting URLs
Hi, one of our customers wanted a content check for a URL looking roughly like: http://100.1.2.3:8080/httpserver/httpserver/isalive.jsp?password=aaa Hobbit barfs on the "/http" in there and thinks this is http check with a proxy URL. The following patch fixes this: --- a/lib/url.c +++ b/lib/url.c @@ -563,7 +563,9 @@ char *decode_url(char *testspec, bburl_t if (poststart) getescapestring(poststart, &bburl->postdata, NULL); if (expstart) getescapestring(expstart, &bburl->expdata, NULL); - p = strstr(urlstart, "/http"); + p = strstr(urlstart, "/http://"); + if (!p) + p = strstr(urlstart, "/https://"); if (p) { proxystart = urlstart; urlstart = (p+1); Christoph -- cb at df7cb.de | http://www.df7cb.de/
Christoph, You are awesome for both identifying and fixing the problem. Thank you so much for supplying this to me =) Josh On 3/19/08, Christoph Berg <cb at df7cb.de> wrote:
Hi,
one of our customers wanted a content check for a URL looking roughly like:
http://100.1.2.3:8080/httpserver/httpserver/isalive.jsp?password=aaa
Hobbit barfs on the "/http" in there and thinks this is http check with a proxy URL. The following patch fixes this:
--- a/lib/url.c +++ b/lib/url.c @@ -563,7 +563,9 @@ char *decode_url(char *testspec, bburl_t if (poststart) getescapestring(poststart, &bburl->postdata, NULL); if (expstart) getescapestring(expstart, &bburl->expdata, NULL);
- p = strstr(urlstart, "/http"); + p = strstr(urlstart, "/http://"); + if (!p) + p = strstr(urlstart, "/https://"); if (p) { proxystart = urlstart; urlstart = (p+1);
Christoph
-- cb at df7cb.de | http://www.df7cb.de/
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH4T/Qxa93SlhRC1oRAm3xAJoChqrBRCxdo0wRMkUAOv4DwaQAaQCggjcz kyOWGzRW/N4FYLnC9UsixEU= =yC9F -----END PGP SIGNATURE-----
-- Josh Luthman Office: 937-552-2340 Direct: 937-552-2343 1100 Wayne St Suite 1337 Troy, OH 45373 Those who don't understand UNIX are condemned to reinvent it, poorly. --- Henry Spencer
participants (2)
-
cb@df7cb.de
-
josh@imaginenetworksllc.com