Kaynağa Gözat

Allow queries in GET requests

tags/v0.9.3
Michael Brown 18 yıl önce
ebeveyn
işleme
af3149d18e
1 değiştirilmiş dosya ile 7 ekleme ve 5 silme
  1. 7
    5
      src/net/tcp/http.c

+ 7
- 5
src/net/tcp/http.c Dosyayı Görüntüle

@@ -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…
İptal
Kaydet