lib/ronin/web/cli/commands/reverse_proxy.rb in ronin-web-1.0.0 vs lib/ronin/web/cli/commands/reverse_proxy.rb in ronin-web-1.0.1

- old
+ new

@@ -1,5 +1,6 @@ +# frozen_string_literal: true # # ronin-web - A collection of useful web helper methods and commands. # # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com) # @@ -179,22 +180,22 @@ # @param [String] value # # @return [(Regexp, String), (String, String)] # def parse_rewrite_rule(value) - if (index = value.rindex('/:')) + if (index = value.rindex('/:')) regexp = Regexp.new(value[1...index]) - replace = value[index+2..] + replace = value[(index + 2)..] return [regexp, replace] elsif (index = value.rindex(':')) string = value[0...index] - replace = value[(index+1)..] + replace = value[(index + 1)..] return [string, replace] end end - + # # Rewrites a request or response body. # # @param [IO, StringIO, Array<String>, String] body #