[gupnp] service: Do not rely on Action header's format



commit 1495d0d7615caa6ad0d6a94108d414915a55c414
Author: Jens Georg <mail jensge org>
Date:   Thu Mar 1 18:22:28 2018 +0100

    service: Do not rely on Action header's format
    
    The code previously relied on the Action header conforming to standard,
    including the ". The code now checks for them and adds if missing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793955

 libgupnp/gupnp-service.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index f81537d..18ecc39 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -836,6 +836,7 @@ new_action_response_str (const char   *action_name,
         g_string_append (str, "Response xmlns:u=");
 
         if (service_type != NULL) {
+                g_string_append_c (str, '"');
                 g_string_append (str, service_type);
                 g_string_append_c (str, '"');
         } else {
@@ -966,6 +967,9 @@ control_server_handler (SoupServer                      *server,
         *action_name = '\0';
         action_name += 1;
 
+        if (*soap_action == '"')
+                soap_action += 1;
+
         /* This memory is libsoup-owned so we can do this */
         end = strrchr (action_name, '"');
         if (end)


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