From b08f857b0d7b2b87b74f6e3ec2992812c13bcb4b Mon Sep 17 00:00:00 2001 From: TaopaiC <124380+TaopaiC@users.noreply.github.com> Date: Fri, 13 Sep 2024 22:18:50 +0800 Subject: [PATCH] Fix encoding issue in encode_path method Fix `encode_path` whitelist to exclude '-' from encoding --- lib/vault/encode.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vault/encode.rb b/lib/vault/encode.rb index 59fb354b..438547e1 100644 --- a/lib/vault/encode.rb +++ b/lib/vault/encode.rb @@ -12,7 +12,7 @@ module EncodePath # # @return [String] def encode_path(path) - path.b.gsub(%r!([^a-zA-Z0-9_.-/]+)!) { |m| + path.b.gsub(%r!([^a-zA-Z0-9_.\-/]+)!) { |m| '%' + m.unpack('H2' * m.bytesize).join('%').upcase } end