[Top][All Lists]

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-73-g20d287

From: Ian Price
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-73-g20d2879
Date: Mon, 19 Aug 2013 09:44:43 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, stable-2.0 has been updated
       via  20d28792b3781e2ca4fd31f4978fc7a0adfbab9a (commit)
      from  088cfb7d761b01a2620d78f10e8dbcaa07485a32 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 20d28792b3781e2ca4fd31f4978fc7a0adfbab9a
Author: Ian Price <address@hidden>
Date:   Mon Aug 19 03:43:48 2013 +0100

    `write-request-line' always prints a path component.
    * module/web/http.scm (write-request-line): Always write "/" when path
      is empty, regardless of query.
    * test-suite/tests/web-http.test ("write-request-line"): Add test.


Summary of changes:
 module/web/http.scm            |    9 +++------
 test-suite/tests/web-http.test |    4 ++++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/module/web/http.scm b/module/web/http.scm
index 21d2964..af04259 100644
--- a/module/web/http.scm
+++ b/module/web/http.scm
@@ -1137,16 +1137,13 @@ three values: the method, the URI, and the version."
           (display host-port port)))))
   (let ((path (uri-path uri))
         (query (uri-query uri)))
-    (if (not (string-null? path))
+    (if (string-null? path)
+        (display "/" port)
         (display path port))
     (if query
           (display "?" port)
-          (display query port)))
-    (if (and (string-null? path)
-             (not query))
-        ;; Make sure we display something.
-        (display "/" port)))
+          (display query port))))
   (display #\space port)
   (write-http-version version port)
   (display "\r\n" port))
diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test
index b2c5c2c..e24a268 100644
--- a/test-suite/tests/web-http.test
+++ b/test-suite/tests/web-http.test
@@ -173,6 +173,10 @@
                               (build-uri 'http
                                          #:path "/pub/WWW/TheProject.html")
                               (1 . 1))
+  (pass-if-write-request-line "GET /?foo HTTP/1.1"
+                              GET
+                              (build-uri 'http #:query "foo")
+                              (1 . 1))
   (pass-if-write-request-line "HEAD /etc/hosts?foo=bar HTTP/1.1"
                               (build-uri 'http

GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]