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



commit daff5f134ff7fa3a7df723768b44c096422673e6
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 8fc12d9..0417852 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -837,6 +837,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 {
@@ -967,6 +968,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]