guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-163-g6f4cc


From: Mark H Weaver
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.9-163-g6f4cc6a
Date: Tue, 21 Jan 2014 01:55: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".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=6f4cc6a31eaf9a55730e85a096846caaf5a940fc

The branch, stable-2.0 has been updated
       via  6f4cc6a31eaf9a55730e85a096846caaf5a940fc (commit)
      from  8ca97482b01cf1a6aa538cc5a2d1f71fb60f080c (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 6f4cc6a31eaf9a55730e85a096846caaf5a940fc
Author: Andy Wingo <address@hidden>
Date:   Sat Jan 18 21:08:52 2014 +0100

    Add support for content-disposition
    
    * module/web/http.scm ("Content-Disposition"): Add a parser and
      serializer.  Defined in RFC2616 section 19.5.1.
    
    * test-suite/tests/web-http.test ("entity headers"): New test case.

-----------------------------------------------------------------------

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

diff --git a/module/web/http.scm b/module/web/http.scm
index 6c9ab95..d22c70c 100644
--- a/module/web/http.scm
+++ b/module/web/http.scm
@@ -1,6 +1,6 @@
 ;;; HTTP messages
 
-;; Copyright (C)  2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+;; Copyright (C)  2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
 
 ;; This library is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU Lesser General Public
@@ -1483,6 +1483,30 @@ treated specially, and is just returned as a plain 
string."
 ;;
 (declare-symbol-list-header! "Allow")
 
+;; Content-Disposition = disposition-type *( ";" disposition-parm )
+;; disposition-type = "attachment" | disp-extension-token
+;; disposition-parm = filename-parm | disp-extension-parm
+;; filename-parm = "filename" "=" quoted-string
+;; disp-extension-token = token
+;; disp-extension-parm = token "=" ( token | quoted-string )
+;;
+(declare-header! "Content-Disposition"
+  (lambda (str)
+    (let ((disposition (parse-param-list str default-val-parser)))
+      ;; Lazily reuse the param list parser.
+      (unless (and (pair? disposition)
+                   (null? (cdr disposition)))
+        (bad-header-component 'content-disposition str))
+      (car disposition)))
+  (lambda (val)
+    (and (pair? val)
+         (symbol? (car val))
+         (list-of? (cdr val)
+                   (lambda (x)
+                     (and (pair? x) (symbol? (car x)) (string? (cdr x)))))))
+  (lambda (val port)
+    (write-param-list (list val) port)))
+
 ;; Content-Encoding = 1#content-coding
 ;;
 (declare-symbol-list-header! "Content-Encoding")
diff --git a/test-suite/tests/web-http.test b/test-suite/tests/web-http.test
index e24a268..aa607af 100644
--- a/test-suite/tests/web-http.test
+++ b/test-suite/tests/web-http.test
@@ -1,6 +1,6 @@
 ;;;; web-uri.test --- URI library          -*- mode: scheme; coding: utf-8; -*-
 ;;;;
-;;;;   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2010, 2011, 2014 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -252,6 +252,8 @@
 
 (with-test-prefix "entity headers"
   (pass-if-parse allow "foo, bar" '(foo bar))
+  (pass-if-parse content-disposition "form-data; name=\"file\"; 
filename=\"q.go\""
+                 '(form-data (name . "file") (filename . "q.go")))
   (pass-if-parse content-encoding "qux, baz" '(qux baz))
   (pass-if-parse content-language "qux, baz" '("qux" "baz"))
   (pass-if-parse content-length "100" 100)


hooks/post-receive
-- 
GNU Guile



reply via email to

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