[gupnp] Enforce HTTP version 1.1



commit ad5162021a4aa8b861bd6eb87f1ec06a62a53d60
Author: Parthiban Balasubramanian <p balasubramanian cablelabs com>
Date:   Wed Oct 30 11:05:55 2013 -0600

    Enforce HTTP version 1.1
    
    Device description requests must also respond with 1.1 version same as
    service description requests.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711167

 libgupnp/gupnp-context.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 94c0cc5..a00a799 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -892,6 +892,17 @@ host_path_handler (G_GNUC_UNUSED SoupServer        *server,
                 goto DONE;
         }
 
+        /* Always send HTTP 1.1 for device description requests
+         * Also set Connection: close header, since the request originated
+         * from a HTTP 1.0 client
+         */
+        if (soup_message_get_http_version (msg) == SOUP_HTTP_1_0) {
+                soup_message_set_http_version (msg, SOUP_HTTP_1_1);
+                soup_message_headers_append (msg->response_headers,
+                                             "Connection",
+                                             "close");
+        }
+
         user_agent = soup_message_headers_get_one (msg->request_headers,
                                                    "User-Agent");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]