Skip to content

Commit 4c430f9

Browse files
committed
Don't check tainting in access log escaping
Only untaint result on Ruby <2.7, as taint support is deprecated in Ruby 2.7+ and no longer has an effect.
1 parent 6b6990e commit 4c430f9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/webrick/accesslog.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,9 @@ def format(format_string, params)
149149
# Escapes control characters in +data+
150150

151151
def escape(data)
152-
if data.tainted?
153-
data.gsub(/[[:cntrl:]\\]+/) {$&.dump[1...-1]}.untaint
154-
else
155-
data
156-
end
152+
data = data.gsub(/[[:cntrl:]\\]+/) {$&.dump[1...-1]}
153+
data.untaint if RUBY_VERSION < '2.7'
154+
data
157155
end
158156
end
159157
end

0 commit comments

Comments
 (0)