fix: Path traversal at SwaggerController (#6205)

This commit is contained in:
ooooooo_q
2023-01-12 23:44:21 +05:30
committed by GitHub
parent 9bbadc2388
commit 9e4a5d028c
+2 -2
View File
@@ -11,8 +11,8 @@ class SwaggerController < ApplicationController
def derived_path
params[:path] ||= 'index.html'
path = params[:path]
path << ".#{params[:format]}" unless path.ends_with?(params[:format].to_s)
path = Rack::Utils.clean_path_info(params[:path])
path << ".#{Rack::Utils.clean_path_info(params[:format])}" unless path.ends_with?(params[:format].to_s)
path
end
end