From 2c43727f8e689ef5998d773feb4cbb2f58009391 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 21 Jan 2011 08:53:56 +0000 Subject: delegate method_missing calls to the response body Since we delegated response_to?, we also need to delegate method_missing to the response body in case there are non-standard methods defined outside of Rack. --- ext/clogger_ext/clogger.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext') diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c index 94301fc..c605c1a 100644 --- a/ext/clogger_ext/clogger.c +++ b/ext/clogger_ext/clogger.c @@ -926,6 +926,12 @@ static VALUE to_io(VALUE self) return io; } +/* :nodoc: */ +static VALUE body(VALUE self) +{ + return clogger_get(self)->body; +} + void Init_clogger_ext(void) { VALUE tmp; @@ -958,6 +964,7 @@ void Init_clogger_ext(void) rb_define_method(cClogger, "to_path", to_path, 0); rb_define_method(cClogger, "to_io", to_io, 0); rb_define_method(cClogger, "respond_to?", respond_to, 1); + rb_define_method(cClogger, "body", body, 0); CONST_GLOBAL_STR(REMOTE_ADDR); CONST_GLOBAL_STR(HTTP_X_FORWARDED_FOR); CONST_GLOBAL_STR(REQUEST_METHOD); -- cgit v1.2.3-24-ge0c7