Header parsing test: verify that a full URI can appear after the "GET"
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 10 Jan 2012 15:56:08 +0000 (15:56 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 3 Feb 2012 13:50:19 +0000 (13:50 +0000)
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
tests/header-parsing.c

index 626b27c..fcdd550 100644 (file)
@@ -177,6 +177,30 @@ static struct RequestTest {
          }
        },
 
+       { "GET with full URI",
+         "GET http://example.com HTTP/1.1\r\n", -1,
+         SOUP_STATUS_OK,
+         "GET", "http://example.com", SOUP_HTTP_1_1,
+         { { NULL } }
+       },
+
+       { "GET with full URI in upper-case",
+         "GET HTTP://example.com HTTP/1.1\r\n", -1,
+         SOUP_STATUS_OK,
+         "GET", "HTTP://example.com", SOUP_HTTP_1_1,
+         { { NULL } }
+       },
+
+       /* It's better for this to be passed through: this means a SoupServer
+        * could implement ftp-over-http proxying, for instance
+        */
+       { "GET with full URI of unrecognised scheme",
+         "GET AbOuT: HTTP/1.1\r\n", -1,
+         SOUP_STATUS_OK,
+         "GET", "AbOuT:", SOUP_HTTP_1_1,
+         { { NULL } }
+       },
+
        /****************************/
        /*** RECOVERABLE REQUESTS ***/
        /****************************/