about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-01 19:04:52 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-01 19:04:52 -0700
commit144e9909ea0f875b3dd58c6c850e25ed9f70c3cb (patch)
tree522e0bd781829e42f2aaf0390f15e75f8a05711d /ext
parent98d72e530ae0e7899aee88bcb0a607e046b32965 (diff)
downloadclogger-144e9909ea0f875b3dd58c6c850e25ed9f70c3cb.tar.gz
Back in HTTP/0.9 days (before it was called HTTP/0.9),
"GET /uri/goes/here\r\n" was a valid HTTP request.

See rfc 1945, section 4.1 for details on this ancient
"Simple-Request" scheme used by HTTP/0.9 clients.
Diffstat (limited to 'ext')
-rw-r--r--ext/clogger_ext/clogger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c
index 19386e5..2dc1ddc 100644
--- a/ext/clogger_ext/clogger.c
+++ b/ext/clogger_ext/clogger.c
@@ -461,12 +461,12 @@ static void append_request(struct clogger *c)
 
         append_request_uri(c);
 
-        rb_str_buf_append(c->log_buf, g_space);
-
         /* HTTP_VERSION can be injected by malicious clients */
         tmp = rb_hash_aref(c->env, g_HTTP_VERSION);
-        if (!NIL_P(tmp))
+        if (!NIL_P(tmp)) {
+                rb_str_buf_append(c->log_buf, g_space);
                 rb_str_buf_append(c->log_buf, byte_xs(tmp));
+        }
 }
 
 static void append_request_length(struct clogger *c)