Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
rubygem-rack
rubygem-rack-CVE-2024-25126.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rubygem-rack-CVE-2024-25126.patch of Package rubygem-rack
Index: rack-1.6.13/lib/rack/request.rb =================================================================== --- rack-1.6.13.orig/lib/rack/request.rb +++ rack-1.6.13/lib/rack/request.rb @@ -42,7 +42,12 @@ module Rack # For more information on the use of media types in HTTP, see: # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 def media_type - content_type && content_type.split(/\s*[;,]\s*/, 2).first.downcase + return nil unless content_type + if type = content_type.split(/[;,]/, 2).first + type.rstrip! + type.downcase! + type + end end # The media type parameters provided in CONTENT_TYPE as a Hash, or @@ -52,9 +57,12 @@ module Rack # { 'charset' => 'utf-8' } def media_type_params return {} if content_type.nil? - Hash[*content_type.split(/\s*[;,]\s*/)[1..-1]. - collect { |s| s.split('=', 2) }. - map { |k,v| [k.downcase, strip_doublequotes(v)] }.flatten] + content_type.split(SPLIT_PATTERN)[1..-1].each_with_object({}) do |s, hsh| + s.strip! + k, v = s.split('=', 2) + k.downcase! + hsh[k] = strip_doublequotes(v) + end end # The character set of the request body if a "charset" media type
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor