#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <ctype.h>
#include "../libntlm/ntlm.h"
#include "proto.h"
FREE_AND_NULL(connection->rheader->content_encoding);
if (connection->header->accept_encoding != NULL) {
/* compress the content if the browser supports gzip encoding */
- ptr = strcasestr(connection->header->accept_encoding, "gzip");
+ char *s, *accept_encoding_lower = xstrdup(connection->header->accept_encoding);
+
+ /* strcasestr(3) is not available on some systems; use strstr(3) instead */
+ for (s=accept_encoding_lower; *s; s++)
+ *s=tolower(*s);
+ ptr = strstr(accept_encoding_lower, "gzip");
if (ptr != NULL) {
ret = filebuf_gzip(filebuf);
if (ret == TRUE) connection->rheader->content_encoding = xstrdup("gzip");
}
+ free(accept_encoding_lower);
}
bypass: