mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 18:56:13 +00:00
Ruby: Fixed CodeQL polynomial regexp (#18699)
This commit is contained in:
committed by
GitHub
parent
e9f961e36e
commit
8924083d73
@@ -64,7 +64,7 @@ module {{moduleName}}
|
||||
# @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.
|
||||
@@ -143,7 +143,7 @@ module {{moduleName}}
|
||||
# @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 = {})
|
||||
|
||||
@@ -249,7 +249,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.
|
||||
@@ -328,7 +328,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 = {})
|
||||
|
||||
@@ -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 = {})
|
||||
|
||||
@@ -212,7 +212,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.
|
||||
@@ -291,7 +291,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 = {})
|
||||
|
||||
@@ -212,7 +212,7 @@ module Petstore
|
||||
# @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.
|
||||
@@ -291,7 +291,7 @@ module Petstore
|
||||
# @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 = {})
|
||||
|
||||
@@ -249,7 +249,7 @@ module Petstore
|
||||
# @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.
|
||||
@@ -328,7 +328,7 @@ module Petstore
|
||||
# @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 = {})
|
||||
|
||||
@@ -188,7 +188,7 @@ module Petstore
|
||||
# @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 Petstore
|
||||
# @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 = {})
|
||||
|
||||
@@ -212,7 +212,7 @@ module Petstore
|
||||
# @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.
|
||||
@@ -291,7 +291,7 @@ module Petstore
|
||||
# @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 = {})
|
||||
|
||||
@@ -212,7 +212,7 @@ module XAuthIDAlias
|
||||
# @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.
|
||||
@@ -291,7 +291,7 @@ module XAuthIDAlias
|
||||
# @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 = {})
|
||||
|
||||
@@ -211,7 +211,7 @@ module DynamicServers
|
||||
# @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.
|
||||
@@ -290,7 +290,7 @@ module DynamicServers
|
||||
# @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 = {})
|
||||
|
||||
@@ -211,7 +211,7 @@ module Petstore
|
||||
# @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.
|
||||
@@ -290,7 +290,7 @@ module Petstore
|
||||
# @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 = {})
|
||||
|
||||
Reference in New Issue
Block a user