Sha256: c652654178fc51e16b3cb4337a1fe08b7b171b835cc174b5011b1685ef31ce97
Contents?: true
Size: 717 Bytes
Versions: 13
Compression:
Stored size: 717 Bytes
Contents
# # Rack doesn't works well with ruby 1.9.2 # there's no :each method in String anymore # class Rack::Response def each(&callback) if @body.is_a? String @body.each_char(&callback) else @body.each(&callback) end @writer = callback @block.call(self) if @block end end class Rack::Request alias_method :params_with_wrong_encoding, :params def params @params ||= encode_in_utf8(params_with_wrong_encoding) end protected def encode_in_utf8 hash r = {} hash.each do |k, v| r[k] = if v.is_a? String v.force_encoding("UTF-8") elsif v.is_a? Hash encode_in_utf8(v) else v end end end end
Version data entries
13 entries across 13 versions & 1 rubygems