From aa1f4700a2461f3f80abd219e874d0edd9a0c599 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Wed, 6 Jul 2022 18:48:57 -0700 Subject: Hex escape unprintable bytes in common logger (#1904) When using \x prefix, users would expect hex escaping. --- test/spec_common_logger.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/spec_common_logger.rb') diff --git a/test/spec_common_logger.rb b/test/spec_common_logger.rb index f5f182aa..be020073 100644 --- a/test/spec_common_logger.rb +++ b/test/spec_common_logger.rb @@ -110,9 +110,9 @@ describe Rack::CommonLogger do it "escapes non printable characters except newline" do logdev = StringIO.new log = Logger.new(logdev) - Rack::MockRequest.new(Rack::CommonLogger.new(app_without_lint, log)).request("GET\b", "/hello") + Rack::MockRequest.new(Rack::CommonLogger.new(app_without_lint, log)).request("GET\x1f", "/hello") - logdev.string.must_match(/GET\\x8 \/hello HTTP\/1\.1/) + logdev.string.must_match(/GET\\x1f \/hello HTTP\/1\.1/) end it "log path with PATH_INFO" do -- cgit v1.2.3-24-ge0c7