Skip to content

Instantly share code, notes, and snippets.

@axiak
Created March 18, 2012 15:18
Show Gist options
  • Save axiak/2075230 to your computer and use it in GitHub Desktop.
Save axiak/2075230 to your computer and use it in GitHub Desktop.
Fixes invalid newline usage for HTTP responses in arc
--- /a/srv.arc 2009-06-29 12:54:11.000000000 -0400
+++ /b/srv.arc 2012-03-18 10:50:17.903238925 -0400
@@ -134,11 +134,11 @@
(if srv-noisy* (pr c))
(-- n)
(push c line))
- (if srv-noisy* (pr "\n\n"))
+ (if srv-noisy* (pr "\r\n\r\n"))
(respond o op (+ (parseargs (string (rev line))) args) cooks ip))))
-(= header* "HTTP/1.1 200 OK
-Content-Type: text/html; charset=utf-8
+(= header* "HTTP/1.1 200 OK\r
+Content-Type: text/html; charset=utf-8\r
Connection: close")
(= type-header* (table))
@@ -147,7 +147,7 @@
(+ "HTTP/1.0 200 OK
Content-Type: "
ctype
- "
+ "\r
Connection: close"))
(map (fn ((k v)) (= (type-header* k) (gen-type-header v)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment