Sha256: 9a32085081b17a715852d2f5fd42da9c2c49abffe5cfab14bb562d9f38068e62

Contents?: true

Size: 556 Bytes

Versions: 114

Compression:

Stored size: 556 Bytes

Contents

# Fixed in later versions of 3.2 (like 3.2.13 or 3.2.14 maybe)
# Rails doesn't handle multipart json correctly
# See http://stackoverflow.com/a/14269110

module ActiveSupport::JSON::Encoding
  def self.escape(string)
    if string.respond_to?(:force_encoding)
      string = string.encode(::Encoding::UTF_8, :undef => :replace).force_encoding(::Encoding::BINARY)
    end
    json = string.gsub(escape_regex) { |s| ESCAPED_CHARS[s] }
    json = %("#{json}")
    json.force_encoding(::Encoding::UTF_8) if json.respond_to?(:force_encoding)
    json
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
katello-3.15.3.1 config/initializers/multipart_json_fix.rb
katello-3.15.3 config/initializers/multipart_json_fix.rb
katello-3.15.2 config/initializers/multipart_json_fix.rb
katello-3.15.1.1 config/initializers/multipart_json_fix.rb
katello-3.15.1 config/initializers/multipart_json_fix.rb
katello-3.15.0.1 config/initializers/multipart_json_fix.rb
katello-3.15.0 config/initializers/multipart_json_fix.rb
katello-3.15.0.rc2 config/initializers/multipart_json_fix.rb
katello-3.15.0.rc1.3 config/initializers/multipart_json_fix.rb
katello-3.15.0.rc1.2 config/initializers/multipart_json_fix.rb
katello-3.15.0.rc1.1 config/initializers/multipart_json_fix.rb
katello-3.15.0.rc1 config/initializers/multipart_json_fix.rb
katello-3.14.1 config/initializers/multipart_json_fix.rb
katello-3.13.4 config/initializers/multipart_json_fix.rb
katello-3.14.0 config/initializers/multipart_json_fix.rb
katello-3.13.3 config/initializers/multipart_json_fix.rb
katello-3.14.0.rc2 config/initializers/multipart_json_fix.rb
katello-3.13.2 config/initializers/multipart_json_fix.rb
katello-3.14.0.rc1 config/initializers/multipart_json_fix.rb
katello-3.13.1 config/initializers/multipart_json_fix.rb