[rygel] core: Error on wrong "getcontentFeatures.dlna.org"



commit c3f1ef0256ac58bd52de34331f3cd38941b31381
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Sep 2 13:16:47 2009 +0300

    core: Error on wrong "getcontentFeatures.dlna.org"
    
    Return error code 400 if getcontentFeatures.dlna.org is other than "1".

 src/rygel/rygel-http-request.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/rygel/rygel-http-request.vala b/src/rygel/rygel-http-request.vala
index 96ea6f2..580d11c 100644
--- a/src/rygel/rygel-http-request.vala
+++ b/src/rygel/rygel-http-request.vala
@@ -68,8 +68,12 @@ internal class Rygel.HTTPRequest : GLib.Object, Rygel.StateMachine {
 
         this.server.pause_message (this.msg);
 
-        if (this.msg.method != "HEAD" && this.msg.method != "GET") {
-            /* We only entertain 'HEAD' and 'GET' requests */
+        var header = this.msg.request_headers.get (
+                                        "getcontentFeatures.dlna.org");
+
+        /* We only entertain 'HEAD' and 'GET' requests */
+        if ((this.msg.method != "HEAD" && this.msg.method != "GET") ||
+            (header != null && header != "1")) {
             this.handle_error (
                         new HTTPRequestError.BAD_REQUEST ("Invalid Request"));
             return;



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