Fix vulnerable.
This commit is contained in:
parent
80ea117b1a
commit
b2c1e7e305
|
@ -7,7 +7,7 @@ class ArchivesController < ApplicationController
|
||||||
def serve_cmap
|
def serve_cmap
|
||||||
file_name = File.basename(params[:file_name].to_s)
|
file_name = File.basename(params[:file_name].to_s)
|
||||||
extension = File.basename(params[:extension].to_s)
|
extension = File.basename(params[:extension].to_s)
|
||||||
serve_path=File.expand_path("../../assets/javascripts/archive/pdf/bcmaps/#{file_name}.#{extension}",__FILE__)
|
serve_path = File.expand_path("../../assets/javascripts/archive/pdf/bcmaps/#{file_name}.#{extension}",__FILE__)
|
||||||
if Dir.glob(serve_path).length != 0
|
if Dir.glob(serve_path).length != 0
|
||||||
send_file(serve_path, type: "application/octet-stream")
|
send_file(serve_path, type: "application/octet-stream")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue