# Could RAW\_POST\_DATA be altered?

**URL:** <https://www.ruby-forum.com/t/could-raw-post-data-be-altered/137117>\
**Category:** Rails\
**Created:** [May 9, 2008, 2:26am UTC](https://www.ruby-forum.com/t/could-raw-post-data-be-altered/137117 "2008-05-09T02:26:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [May 9, 2008, 2:26am UTC](https://www.ruby-forum.com/t/could-raw-post-data-be-altered/137117/1 "2008-05-09T02:26:39Z")

</div>

I’ve been working on a very low-level issue on RubyAMF.

In a nutshell, I need to figure out if its at all possible that rails’  
request.env[‘RAW\_POST\_DATA’] or request.raw\_post for that matter could  
possibly be interpretting a byte stream and mistakingly truncating it by  
a byte or two in certain places.

For example, in this byte stream lies a compressing Gzipped stream. And  
sometimes (like 1 in 100) this stream will be short a couple of  
characters (like 1-3) and appear corrupted.

How can I access the raw data before ruby/rails puts its hands on it.  
Anyway to dip into the CGI directly. I want as few operations on the  
RAW\_POST\_DATA as possible.

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [May 9, 2008, 8:51am UTC](https://www.ruby-forum.com/t/could-raw-post-data-be-altered/137117/2 "2008-05-09T08:51:12Z")

</div>

On May 9, 1:26 am, Aryk G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I’ve been working on a very low-level issue on RubyAMF.
> 
> In a nutshell, I need to figure out if its at all possible that rails’  
> request.env[‘RAW\_POST\_DATA’] or request.raw\_post for that matter could  
> possibly be interpretting a byte stream and mistakingly truncating it by  
> a byte or two in certain places.

There’s a thing where (to work around a bug in safari) the last byte  
of a post request is dropped if it is 0  
(see clean\_up\_ajax\_request\_body in action\_controller/request.rb)

Fred
