Ruby: Fixed CodeQL polynomial regexp (#18699)

This commit is contained in:
RiccardoPetteruti-Onfido
2024-05-19 11:28:04 +02:00
committed by GitHub
parent e9f961e36e
commit 8924083d73
11 changed files with 22 additions and 22 deletions

View File

@@ -188,7 +188,7 @@ module OpenapiClient
# @param [String] mime MIME
# @return [Boolean] True if the MIME is application/json
def json_mime?(mime)
(mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
end
# Deserialize the response to the given return type.
@@ -267,7 +267,7 @@ module OpenapiClient
# @param [String] filename the filename to be sanitized
# @return [String] the sanitized filename
def sanitize_filename(filename)
filename.gsub(/.*[\/\\]/, '')
filename.split(/[\/\\]/).last
end
def build_request_url(path, opts = {})