From 144e9909ea0f875b3dd58c6c850e25ed9f70c3cb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Sep 2009 19:04:52 -0700 Subject: correctly rebuild simple HTTP/0.9 GET requests 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. --- ext/clogger_ext/clogger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') 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) -- cgit v1.2.3-24-ge0c7