Browse Source

Allow queries in GET requests

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
af3149d18e
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      src/net/tcp/http.c

+ 7
- 5
src/net/tcp/http.c View File

@@ -330,15 +330,17 @@ static void http_senddata ( struct stream_application *app,
330 330
 	struct http_request *http = stream_to_http ( app );
331 331
 	const char *path = http->uri->path;
332 332
 	const char *host = http->uri->host;
333
-
334
-	if ( ! path )
335
-		path = "/";
333
+	const char *query = http->uri->query;
336 334
 
337 335
 	len = snprintf ( buf, len,
338
-			 "GET %s HTTP/1.1\r\n"
336
+			 "GET %s%s%s HTTP/1.1\r\n"
339 337
 			 "User-Agent: gPXE/" VERSION "\r\n"
340 338
 			 "Host: %s\r\n"
341
-			 "\r\n", path, host );
339
+			 "\r\n",
340
+			 ( path ? path : "/" ),
341
+			 ( query ? "?" : "" ),
342
+			 ( query ? query : "" ),
343
+			 host );
342 344
 
343 345
 	stream_send ( app, ( buf + http->tx_offset ),
344 346
 		      ( len - http->tx_offset ) );

Loading…
Cancel
Save