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
 	struct http_request *http = stream_to_http ( app );
330
 	struct http_request *http = stream_to_http ( app );
331
 	const char *path = http->uri->path;
331
 	const char *path = http->uri->path;
332
 	const char *host = http->uri->host;
332
 	const char *host = http->uri->host;
333
-
334
-	if ( ! path )
335
-		path = "/";
333
+	const char *query = http->uri->query;
336
 
334
 
337
 	len = snprintf ( buf, len,
335
 	len = snprintf ( buf, len,
338
-			 "GET %s HTTP/1.1\r\n"
336
+			 "GET %s%s%s HTTP/1.1\r\n"
339
 			 "User-Agent: gPXE/" VERSION "\r\n"
337
 			 "User-Agent: gPXE/" VERSION "\r\n"
340
 			 "Host: %s\r\n"
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
 	stream_send ( app, ( buf + http->tx_offset ),
345
 	stream_send ( app, ( buf + http->tx_offset ),
344
 		      ( len - http->tx_offset ) );
346
 		      ( len - http->tx_offset ) );

Loading…
Cancel
Save