From 78c076ebb118a8312a2912dddb8a93d3ea80fa99 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Apr 2009 11:14:42 -0700 Subject: HttpParser: set QUERY_STRING for Rack-compliance --- ext/unicorn/http11/http11.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext/unicorn/http11/http11.c') diff --git a/ext/unicorn/http11/http11.c b/ext/unicorn/http11/http11.c index 42dcf99..fbe2432 100644 --- a/ext/unicorn/http11/http11.c +++ b/ext/unicorn/http11/http11.c @@ -262,6 +262,10 @@ static void header_done(void *data, const char *at, size_t length) VALUE server_port = global_port_80; VALUE temp; + /* rack requires QUERY_STRING */ + if (rb_hash_aref(req, global_query_string) == Qnil) + rb_hash_aset(req, global_query_string, rb_str_new(NULL, 0)); + /* set rack.url_scheme to "https" or "http", no others are allowed by Rack */ if ((temp = rb_hash_aref(req, global_http_x_forwarded_proto)) != Qnil && RSTRING_LEN(temp) == 5 && -- cgit v1.2.3-24-ge0c7