From cb6eb65466b9c744f5c9601c0d00b10b8b051fe1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 4 Nov 2012 14:35:34 +0000 Subject: [PATCH] Use binary mode for trace files We don't want to try and do any enoding conversions (or indeed any newline conversions) on uploaded trace files. --- app/controllers/trace_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 05f97bf0d..4b138bdae 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -368,7 +368,7 @@ private filename = "/tmp/#{rand}" # ...and save the uploaded file to that location - File.open(filename, "w") { |f| f.write(file.read) } + File.open(filename, "wb") { |f| f.write(file.read) } # Create the trace object, falsely marked as already # inserted to stop the import daemon trying to load it -- 2.39.5