I just noticed that if empty string "" is passed into `(redirect-to)`, the response will not include a Location header (even though the header object exists in the response object generated by `(redirect-to)`.<br>
<br>While passing in empty string is a client bug, perhaps it's better to simply stop the input in the first place?<br><br>If so - below is a plausible patch for web-server/http/redirect.ss<br><br>Thanks,<br>yc<br><br>
--- /usr/local/plt/lib/plt/collects/web-server/http/redirect.ss 2008-11-16 11:34:46.000000000 -0800<br>+++ plt-scheme/web-server/http/redirect.ss 2009-03-03 23:00:10.000000000 -0800<br>@@ -24,7 +24,8 @@<br> <br> (provide/contract<br>
[redirect-to<br>- (->* (string?) (redirection-status? #:headers (listof header?))<br>+ (->* ((and/c string? (lambda (s) (> (string-length s) 0))))<br>+ (redirection-status? #:headers (listof header?))<br>
response/full?)]<br> [redirection-status? (any/c . -> . boolean?)]<br> [permanently redirection-status?]<br><br><br>