Also, drop the unused prefix parameter from mime_get_header_field().
const bool switchedToHttps = conn->switchedToHttps();
const bool tryHostHeader = vhost || switchedToHttps;
- if (tryHostHeader && (host = mime_get_header(req_hdr, "Host")) != NULL) {
+ if (tryHostHeader && (host = mime_get_header_field(req_hdr, "Host")) != NULL) {
debugs(33, 5, "ACCEL VHOST REWRITE: vhost=" << host << " + vport=" << vport);
char thost[256];
if (vport > 0) {
/* BUG: Squid cannot deal with '*' URLs (RFC2616 5.1.2) */
- if ((host = mime_get_header(req_hdr, "Host")) != NULL) {
+ if ((host = mime_get_header_field(req_hdr, "Host")) != NULL) {
int url_sz = strlen(url) + 32 + Config.appendDomainLen +
strlen(host);
http->uri = (char *)xcalloc(url_sz, 1);
* field-value matches prefix if any
*/
char *
-mime_get_header_field(const char *mime, const char *name, const char *prefix)
+mime_get_header_field(const char *mime, const char *name)
{
LOCAL_ARRAY(char, header, GET_HDR_SZ);
const char *p = NULL;
char *q = NULL;
char got = 0;
const int namelen = name ? strlen(name) : 0;
- const int preflen = prefix ? strlen(prefix) : 0;
int l;
if (NULL == mime)
got = 1;
}
- if (got && prefix) {
- /* we could process list entries here if we had strcasestr(). */
- /* make sure we did not match a part of another field-value */
- got = !strncasecmp(q, prefix, preflen) && !xisalpha(q[preflen]);
- }
-
if (got) {
debugs(25, 5, "mime_get_header: returning '" << q << "'");
return q;
return NULL;
}
-/* returns a pointer to a field-value of the first matching field-name */
-char *
-mime_get_header(const char *mime, const char *name)
-{
- return mime_get_header_field(mime, name, NULL);
-}
-
size_t
headersEnd(const char *mime, size_t l)
{
#ifndef SQUID_MIME_HEADER_H_
#define SQUID_MIME_HEADER_H_
-char *mime_get_header(const char *mime, const char *header);
-char *mime_get_header_field(const char *mime, const char *name, const char *prefix);
+char *mime_get_header_field(const char *mime, const char *name);
size_t headersEnd(const char *, size_t);
#endif /* SQUID_MIME_HEADER_H_ */