From 39391fe852f155be054baceffcaa1341184919b3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 7 Jan 2009 13:46:52 -0600 Subject: [PATCH] CGI responder would fail if the CGI script would emit non-ASCII characters; set encoding to binary --- basis/http/server/cgi/cgi.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basis/http/server/cgi/cgi.factor b/basis/http/server/cgi/cgi.factor index 59cd62f338..0c2f639cba 100644 --- a/basis/http/server/cgi/cgi.factor +++ b/basis/http/server/cgi/cgi.factor @@ -1,7 +1,7 @@ -! Copyright (C) 2007, 2008 Slava Pestov. +! Copyright (C) 2007, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: namespaces kernel assocs io.files io.streams.duplex -combinators arrays io.launcher io.encodings.binary io +combinators arrays io.launcher io.encodings io.encodings.binary io http.server.static http.server http accessors sequences strings math.parser fry urls urls.encoding calendar ; IN: http.server.cgi @@ -52,6 +52,7 @@ IN: http.server.cgi 200 >>code "CGI output follows" >>message swap '[ + binary encode-output _ output-stream get swap binary [ post-request? [ request get post-data>> raw>> write flush ] when input-stream get swap (stream-copy)