summaryrefslogtreecommitdiffstats
path: root/src/net/tcp
diff options
context:
space:
mode:
authorMichael Brown2016-06-09 13:20:35 +0200
committerMichael Brown2016-06-09 13:27:04 +0200
commitb42e71921fb8169f2c5a409bd095f10bb3c0f1ac (patch)
tree361fe7119d32db5964ad0055fa74b0b31bdda7ad /src/net/tcp
parent[pci] Support systems with multiple PCI root bridges (diff)
downloadipxe-b42e71921fb8169f2c5a409bd095f10bb3c0f1ac.tar.gz
ipxe-b42e71921fb8169f2c5a409bd095f10bb3c0f1ac.tar.xz
ipxe-b42e71921fb8169f2c5a409bd095f10bb3c0f1ac.zip
[http] Accept headers with no whitespace following the colon
Reported-by: Raphael Cohn <raphael.cohn@stormmq.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/tcp')
-rw-r--r--src/net/tcp/httpcore.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net/tcp/httpcore.c b/src/net/tcp/httpcore.c
index 57b89762..b1f74bc4 100644
--- a/src/net/tcp/httpcore.c
+++ b/src/net/tcp/httpcore.c
@@ -1201,13 +1201,17 @@ static int http_parse_header ( struct http_transaction *http, char *line ) {
DBGC2 ( http, "HTTP %p RX %s\n", http, line );
/* Extract header name */
- sep = strstr ( line, ": " );
+ sep = strchr ( line, ':' );
if ( ! sep ) {
DBGC ( http, "HTTP %p malformed header \"%s\"\n", http, line );
return -EINVAL_HEADER;
}
*sep = '\0';
- line = ( sep + 2 /* ": " */ );
+
+ /* Extract remainder of line */
+ line = ( sep + 1 );
+ while ( isspace ( *line ) )
+ line++;
/* Process header, if recognised */
for_each_table_entry ( header, HTTP_RESPONSE_HEADERS ) {