+2007-09-24 Dan Winship <danw@gnome.org>
+
+ * libsoup/soup-date.c (soup_date_parse): minor rfc850-date parsing
+ improvement suggested by RFC2616 19.3.
+
+ * libsoup/soup-headers.c (soup_headers_parse_request): allow
+ erroneous trailing whitespace after HTTP version. #475169
+
+ * libsoup/soup-message-server-io.c (parse_request_headers): fix
+ the parsing of the Host header to assume it already includes the
+ port (which it should; the only reason this ever worked is because
+ SoupUri ignores the second port number when parse_request_headers
+ generates a URL like "http://localhost:9999:9999/").
+
+ * tests/header-parsing.c (reqtests): add a test for #475169
+
2007-09-23 Dan Winship <danw@gnome.org>
* libsoup/soup-message.c (soup_message_class_init): remove a
tm.tm_mday = atoi (timestamp + 2);
tm.tm_mon = parse_month (timestamp + 5);
tm.tm_year = atoi (timestamp + 9);
+ if (tm.tm_year < 70)
+ tm.tm_year += 100;
tm.tm_hour = atoi (timestamp + 12);
tm.tm_min = atoi (timestamp + 15);
tm.tm_sec = atoi (timestamp + 18);
return FALSE;
headers = version + 8;
- if (headers < str + len && *headers == '\r')
+ while (headers < str + len && (*headers == '\r' || *headers == ' '))
headers++;
if (headers >= str + len || *headers != '\n')
return FALSE;
return SOUP_STATUS_BAD_REQUEST;
}
} else if (req_host) {
- url = g_strdup_printf ("%s://%s:%d%s",
+ url = g_strdup_printf ("%s://%s%s",
soup_server_get_protocol (server) == SOUP_PROTOCOL_HTTPS ? "https" : "http",
- req_host, soup_server_get_port (server),
- req_path);
+ req_host, req_path);
} else if (priv->http_version == SOUP_HTTP_1_0) {
/* No Host header, no AbsoluteUri */
SoupAddress *addr = soup_socket_get_local_address (sock);
}
},
+ { "Req w/ incorrect whitespace after Request-Line",
+ "GET / HTTP/1.1 \r\nHost: example.com\r\n", -1,
+ "GET", "/", SOUP_HTTP_1_1,
+ { { "Host", "example.com" },
+ { NULL }
+ }
+ },
+
/************************/
/*** INVALID REQUESTS ***/
/************************/