X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=urlmatch.c;h=6949eedb82d2716f306ba8c0b73a2d4576813433;hp=f1742c89ac48629d8fc06315c99d07e896660702;hb=83fec2e8aed9e9798566f1c0aafe226e8822e3df;hpb=d01bb4028a9d19a62672a8d7d8d13f09ae270851 diff --git a/urlmatch.c b/urlmatch.c index f1742c89..6949eedb 100644 --- a/urlmatch.c +++ b/urlmatch.c @@ -6,7 +6,7 @@ * patterns. * * Copyright : Written by and Copyright (C) 2001-2014 - * the Privoxy team. http://www.privoxy.org/ + * the Privoxy team. https://www.privoxy.org/ * * Based on the Internet Junkbuster originally written * by and Copyright (C) 1997 Anonymous Coders and @@ -87,7 +87,7 @@ void free_http_request(struct http_request *http) freez(http->url); freez(http->hostport); freez(http->path); - freez(http->ver); + freez(http->version); freez(http->host_ip_addr_str); #ifndef FEATURE_EXTENDED_HOST_PATTERNS freez(http->dbuffer); @@ -291,12 +291,17 @@ jb_err parse_http_url(const char *url, struct http_request *http, int require_pr /* * Got a path. * - * NOTE: The following line ignores the path for HTTPS URLS. - * This means that you get consistent behaviour if you type a - * https URL in and it's parsed by the function. (When the - * URL is actually retrieved, SSL hides the path part). + * If FEATURE_HTTPS_INSPECTION isn't available, ignore the + * path for https URLs so that we get consistent behaviour + * if a https URL is parsed. When the URL is actually + * retrieved, https hides the path part. */ - http->path = strdup_or_die(http->ssl ? "/" : url_path); + http->path = strdup_or_die( +#ifndef FEATURE_HTTPS_INSPECTION + http->ssl ? "/" : +#endif + url_path + ); *url_path = '\0'; http->hostport = strdup_or_die(url_noproto); } @@ -587,7 +592,7 @@ jb_err parse_http_request(const char *req, struct http_request *http) */ http->cmd = strdup_or_die(req); http->gpc = strdup_or_die(v[0]); - http->ver = strdup_or_die(v[2]); + http->version = strdup_or_die(v[2]); http->ocmd = strdup_or_die(http->cmd); freez(buf); @@ -1440,20 +1445,23 @@ jb_err parse_forwarder_address(char *address, char **hostname, int *port, char **username, char **password) { char *p; - *hostname = strdup_or_die(address); + char *tmp; + + tmp = *hostname = strdup_or_die(address); /* Parse username and password */ if (username && password && (NULL != (p = strchr(*hostname, '@')))) { *p++ = '\0'; - *username = *hostname; - *hostname = p; + *username = strdup_or_die(*hostname); + *hostname = strdup_or_die(p); if (NULL != (p = strchr(*username, ':'))) { *p++ = '\0'; *password = strdup_or_die(p); } + freez(tmp); } /* Parse hostname and port */