#include <assert.h>
#include <string.h>
-#if !defined(_WIN32) && !defined(__OS2__)
+#if !defined(_WIN32)
#include <unistd.h>
#endif
url_path
);
*url_path = '\0';
- http->hostport = strdup_or_die(url_noproto);
+ http->hostport = string_tolower(url_noproto);
}
else
{
* or CONNECT requests
*/
http->path = strdup_or_die("/");
- http->hostport = strdup_or_die(url_noproto);
+ http->hostport = string_tolower(url_noproto);
}
freez(buf);
+
+ if (http->hostport == NULL)
+ {
+ return JB_ERR_PARSE;
+ }
}
if (!host_available)
{
assert(http->host != NULL);
#ifdef FEATURE_PCRE_HOST_PATTERNS
- if (pattern->pattern.url_spec.host_regex_type == PCRE_HOST_PATTERN) {
+ if (pattern->pattern.url_spec.host_regex_type == PCRE_HOST_PATTERN)
+ {
return ((NULL == pattern->pattern.url_spec.host_regex)
|| (0 == regexec(pattern->pattern.url_spec.host_regex,
http->host, 0, NULL, 0)));