# Handling "puts" stmts. from external libraries w/Apache+FCGI

**URL:** <https://www.ruby-forum.com/t/handling-puts-stmts-from-external-libraries-w-apache-fcgi/123701>\
**Category:** Rails\
**Created:** [December 19, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/handling-puts-stmts-from-external-libraries-w-apache-fcgi/123701 "2007-12-19T20:58:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [December 19, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/handling-puts-stmts-from-external-libraries-w-apache-fcgi/123701/1 "2007-12-19T20:58:02Z")

</div>

All,

Rails 1.1.6  
Apache 2  
FCGI

I recently ran into an issue where an external library generated a  
“puts” statement which caused the connection to one of my FCGI processes  
to break because Apache flipped out about the malformed header (the  
argument to the puts statement). The browser never was updated as a  
result.

Is there a generic way for me to “catch” puts statements that are  
introduced by other libraries _before_ they cause such a connection  
breakage as Apache attempts to stream them back as part of the HTML  
response? Some way to validate response.body perhaps?

Would this issue also exist if I were a good boy and using Mongrel like  
I should be?

Thanks,  
Wes
