Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
rwcr authored and Marty Connor committed Jan 27, 2010
1 parent e6f08b0 commit f3467ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/net/tcp/http.c
Expand Up @@ -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 " : "" ),
Expand Down

0 comments on commit f3467ad

Please sign in to comment.