From 2a6da83992ad375e751a07ec78bf71b50ba0d29e Mon Sep 17 00:00:00 2001
From: Samuel Williams <samuel.williams@oriontransfer.co.nz>
Date: Sat, 22 Feb 2025 16:37:33 +1300
Subject: Use `#inspect` to prevent log injection.

---
 lib/rack/sendfile.rb  | 2 +-
 test/spec_sendfile.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/rack/sendfile.rb b/lib/rack/sendfile.rb
index 3774b260..c7db0bf5 100644
--- a/lib/rack/sendfile.rb
+++ b/lib/rack/sendfile.rb
@@ -136,7 +136,7 @@ module Rack
           end
         when '', nil
         else
-          env[RACK_ERRORS].puts "Unknown x-sendfile variation: '#{type}'.\n"
+          env[RACK_ERRORS].puts "Unknown x-sendfile variation: #{type.inspect}"
         end
       end
       [status, headers, body]
diff --git a/test/spec_sendfile.rb b/test/spec_sendfile.rb
index 5c55f4ff..c4c0821f 100644
--- a/test/spec_sendfile.rb
+++ b/test/spec_sendfile.rb
@@ -51,7 +51,7 @@ describe Rack::Sendfile do
       response.headers.wont_include 'X-Sendfile'
 
       io.rewind
-      io.read.must_equal "Unknown x-sendfile variation: 'X-Banana'.\n"
+      io.read.must_equal "Unknown x-sendfile variation: \"X-Banana\"\n"
     end
   end
 
-- 
2.30.2

