Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 2106

Show
Ignore:
Timestamp:
09/02/05 14:40:33 (4 years ago)
Author:
minam
Message:

Drop trailing \000 if present on RAW_POST_DATA (works around bug in Safari Ajax implementation) #918

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r2104 r2106  
    11*SVN* 
     2 
     3* Drop trailing \000 if present on RAW_POST_DATA (works around bug in Safari Ajax implementation) #918 
    24 
    35* Fix observe_field to fall back to event-based observation if frequency <= 0 #1916 [michael@schubert.cx] 
  • trunk/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb

    r1907 r2106  
    5353        stdinput.binmode if stdinput.respond_to?(:binmode) 
    5454        content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || '' 
    55         env_table['RAW_POST_DATA'] = content.split("&_").first.to_s.freeze # &_ is a fix for Safari Ajax postings that always append \000 
     55        # fix for Safari Ajax postings that always append \000 
     56        content = content.chop if content[-1] == 0 
     57        env_table['RAW_POST_DATA'] = content.freeze 
    5658      end 
    5759