mod_mruby
mod_mruby copied to clipboard
Receive empty body on another module when read request body by mruby script.
Hi, I am using Request.body to read POST request on my logging script (like below), request body is being read properly at script, but another module (mod_proxy in my case) receive empty body.
r = Apache::Request.new
if r.method_number == Apache::M_POST and r.uri == '/login'
File.open('path/of/login/log/file', 'a') do |f|
# mask password
bodyMasked = r.body.gsub(/password=[^&]*/, 'password=xxx')
# write body
f.write("#{bodyMasked}\n")
end
end
In my opinion, this problem is caused by ap_get_client_block() method (used by ap_mrb_get_request_body() for read request body).
(ref., http://www.gossamer-threads.com/lists/apache/dev/381941)
Is this behavior correct? or bug?
Sorry for my late response. Yes, it's behavior is correct. But, I want to implement non breaking post read method.
Okay. Thank you for your reply.