about summary refs log tree commit homepage
path: root/ext/clogger_ext/clogger.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/clogger_ext/clogger.c')
-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)