Skip to content

Commit 770f092

Browse files
committed
Use more accurate variable name
1 parent e0837fb commit 770f092

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/metasploit/framework/data_service/remote/http/response_data_helper.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'ostruct'
2+
require 'digest'
23

34
#
45
# HTTP response helper class
@@ -27,21 +28,21 @@ def json_to_open_struct_object(response_wrapper, returns_on_error = nil)
2728
# Saves the file in the location specified in the parameter.
2829
#
2930
# @param base64_file [String] The Base64 encoded file.
30-
# @param save_dir [String] The location to store the file. This should include the file's name.
31+
# @param save_path [String] The location to store the file. This should include the file's name.
3132
# @return [String] The location where the file was successfully stored.
32-
def process_file(base64_file, save_dir)
33+
def process_file(base64_file, save_path)
3334
decoded_file = Base64.urlsafe_decode64(base64_file)
3435
begin
3536
# If we are running the data service on the same box this will ensure we only write
3637
# the file if it is somehow not there already.
37-
unless File.exists?(save_dir) && File.read(save_dir) == decoded_file
38-
File.open(save_dir, 'w+') { |file| file.write(decoded_file) }
38+
unless File.exists?(save_path) && File.read(save_path) == decoded_file
39+
File.open(save_path, 'w+') { |file| file.write(decoded_file) }
3940
end
4041
rescue Exception => e
4142
puts "There was an error writing the file: #{e}"
4243
e.backtrace.each { |line| puts "#{line}\n"}
4344
end
44-
save_dir
45+
save_path
4546
end
4647

4748
#

0 commit comments

Comments
 (0)