From 136d2d65ecdf77e5ced5b22e9c26bdc3c6ccf971 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 5 Oct 2026 13:07:22 +0200 Subject: Fix content-length to use byte count instead of char count on C6 Also, default to utf-8 charsets in default mime type map and default response headers and when sending status responses and in the simple directory handler. --- tests/run.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/run.scm') diff --git a/tests/run.scm b/tests/run.scm index d7e3d27..6e6062d 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -1,5 +1,5 @@ (import test (chicken irregex) (chicken time) (chicken time posix) - (chicken file) intarweb) + (chicken file) (chicken bytevector) intarweb) ;; Change this to (use spiffy) when compiling tests (load "../spiffy.scm") @@ -49,6 +49,8 @@ (let ((p (response-port (current-response)))) (display "foo" p) (close-output-port p)))) + ("utf8-literal-host" . ,(lambda (continue) + (send-response body: "Multi-byte 😎"))) ("subdir-host" . ,(lambda (continue) (parameterize ((root-path "./testweb/subdir")) (continue)))) @@ -225,6 +227,8 @@ (200 "10.0.0.1") "/whats-my-ip" "ip-host" send-headers: `((x-forwarded-for "10.0.0.1"))) +(test-response "Multi-byte response content-length ok" (200 (string->utf8 "Multi-byte 😎")) + "/whatever" "utf8-literal-host" binary: #t) (test-end "miscellaneous") (test-begin "Caching and other efficiency support") -- cgit v1.2.3