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

Ticket #8568 (new enhancement)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Added Deflate support to ARes

Reported by: foeken Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveResource Version: edge
Severity: normal Keywords:
Cc:

Description

Added deflate support to Ares

def xml_from_response(response)
      
      # Check the content-encoding header and act accordingly      
      if response.header["content-encoding"] == "deflate"
        response_body = Zlib::Inflate.inflate(response.body)
      else
        response_body = response.body
      end
      
      if response = from_xml_data(Hash.from_xml(response_body))
        response.first
      else
        nil
      end
    end

Attachments

added_deflate_support.diff (2.5 kB) - added by foeken on 06/08/07 19:10:21.
Properly, with tests

Change History

(follow-up: ↓ 2 ) 06/04/07 21:14:35 changed by manfred

Can you create a patch (diff) for this and add tests? See http://dev.rubyonrails.org/ point 2 and 3 on details.

(in reply to: ↑ 1 ) 06/08/07 10:45:00 changed by foeken

Replying to manfred:

Can you create a patch (diff) for this and add tests? See http://dev.rubyonrails.org/ point 2 and 3 on details.

Will do this weekend :)

06/08/07 19:10:21 changed by foeken

  • attachment added_deflate_support.diff added.

Properly, with tests

06/08/07 19:11:36 changed by foeken

  • summary changed from Added Deflate support to ARes to [PATCH] Added Deflate support to ARes.