summaryrefslogtreecommitdiffstats
path: root/usr.sbin/portsnap
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2008-02-13 20:46:23 +0000
committercperciva <cperciva@FreeBSD.org>2008-02-13 20:46:23 +0000
commit5525e95af09748e937b1b92870caca4a31486bf1 (patch)
tree50fff997bbfd42405b6afbbb999836699ef47ecd /usr.sbin/portsnap
parent456bfb1f0fb4a7ea1eaa495971e03c42af98aa66 (diff)
downloadFreeBSD-src-5525e95af09748e937b1b92870caca4a31486bf1.zip
FreeBSD-src-5525e95af09748e937b1b92870caca4a31486bf1.tar.gz
Improve conformance to the HTTP specification by using case-insensitive
comparisons for header keywords. Apparently some proxies use creative capitalization. Weird proxy found by: brooks MFC after: 3 days
Diffstat (limited to 'usr.sbin/portsnap')
-rw-r--r--usr.sbin/portsnap/phttpget/phttpget.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/portsnap/phttpget/phttpget.c b/usr.sbin/portsnap/phttpget/phttpget.c
index ffd14c3..e109124 100644
--- a/usr.sbin/portsnap/phttpget/phttpget.c
+++ b/usr.sbin/portsnap/phttpget/phttpget.c
@@ -503,11 +503,11 @@ main(int argc, char *argv[])
* Check for "Connection: close" or
* "Connection: Keep-Alive" header
*/
- if (strncmp(hln, "Connection:", 11) == 0) {
+ if (strncasecmp(hln, "Connection:", 11) == 0) {
hln += 11;
- if (strstr(hln, "close") != NULL)
+ if (strcasestr(hln, "close") != NULL)
pipelined = 0;
- if (strstr(hln, "Keep-Alive") != NULL)
+ if (strcasestr(hln, "Keep-Alive") != NULL)
keepalive = 1;
/* Next header... */
@@ -515,7 +515,7 @@ main(int argc, char *argv[])
}
/* Check for "Content-Length:" header */
- if (strncmp(hln, "Content-Length:", 15) == 0) {
+ if (strncasecmp(hln, "Content-Length:", 15) == 0) {
hln += 15;
contentlength = 0;
@@ -539,9 +539,9 @@ main(int argc, char *argv[])
}
/* Check for "Transfer-Encoding: chunked" header */
- if (strncmp(hln, "Transfer-Encoding:", 18) == 0) {
+ if (strncasecmp(hln, "Transfer-Encoding:", 18) == 0) {
hln += 18;
- if (strstr(hln, "chunked") != NULL)
+ if (strcasestr(hln, "chunked") != NULL)
chunked = 1;
/* Next header... */
OpenPOWER on IntegriCloud