[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Patch for Spiffy's ``+'' problem
From: |
Peter Busser |
Subject: |
[Chicken-users] Patch for Spiffy's ``+'' problem |
Date: |
Mon, 6 Feb 2006 21:55:56 +0100 |
User-agent: |
Mutt/1.5.9i |
Hi!
I have fixed the code which prevented Spiffy from serving files with a
``+'' in their filename:
--- http-utils.scm.orig 2006-02-06 15:20:14.000000000 +0100
+++ http-utils.scm 2006-02-06 13:55:02.000000000 +0100
@@ -108,8 +108,16 @@
(parse-encoded-arguments args) ) ]
[else (values (http:canonicalize-string url) '())] ) )
+(define (separate-fields str)
+ (let ((str-list (string-split str "?" #t)))
+ (string-intersperse (cons (car str-list)
+ (map (lambda (s) (string-translate s "+" " "))
+ (cdr str-list)))
+ "?")))
+
+
(define (http:canonicalize-string str)
- (let loop ([i 0] [str (string-translate str "+" " ")])
+ (let loop ([i 0] [str (separate-fields str)])
(match (string-search-positions "%[0-9ABCDEFabcdef]{2}" str i)
[((i1 i2))
(loop
Groetjes,
Peter.
- [Chicken-users] Patch for Spiffy's ``+'' problem,
Peter Busser <=