summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Oreman2010-01-27 05:56:42 +0100
committerMarty Connor2010-01-27 14:52:39 +0100
commitf3467ad169b01d5d90d8474ecc1ab1ee82cdecd1 (patch)
tree26489f8b94408b8402436bd9dcd2b5db96ae791f
parent[uri] Handle an empty unparse_uri() result properly (diff)
downloadipxe-f3467ad169b01d5d90d8474ecc1ab1ee82cdecd1.tar.gz
ipxe-f3467ad169b01d5d90d8474ecc1ab1ee82cdecd1.tar.xz
ipxe-f3467ad169b01d5d90d8474ecc1ab1ee82cdecd1.zip
[http] GET / if URI doesn't contain a path
Commit 3d9dd93 introduced a regression in HTTP: if a URI without a path is specified (e.g. http://netboot.me), we send the empty string as our GET request. Reintroduce an extra slash when uri->path is NULL, to turn this into the expected GET /. Reported-by: Kyle Kienapfel <doctor.whom@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
-rw-r--r--src/net/tcp/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/tcp/http.c b/src/net/tcp/http.c
index 807a0c3e..a365b2a4 100644
--- a/src/net/tcp/http.c
+++ b/src/net/tcp/http.c
@@ -452,11 +452,12 @@ static void http_step ( struct process *process ) {
/* Send GET request */
if ( ( rc = xfer_printf ( &http->socket,
- "GET %s HTTP/1.0\r\n"
+ "GET %s%s HTTP/1.0\r\n"
"User-Agent: gPXE/" VERSION "\r\n"
"%s%s%s"
"Host: %s\r\n"
"\r\n",
+ http->uri->path ? "" : "/",
request,
( user ?
"Authorization: Basic " : "" ),