Skip to content

Commit 7808ab0

Browse files
p-mongop
authored andcommitted
RUBY-2035 Use URI::DEFAULT_PARSER.unescape instead of URI.decode for Ruby 2.7 (#1614)
1 parent cc69560 commit 7808ab0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/mongo/uri.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def raise_invalid_error_no_fmt!(details)
454454
end
455455

456456
def decode(value)
457-
::URI.decode(value)
457+
::URI::DEFAULT_PARSER.unescape(value)
458458
end
459459

460460
def encode(value)

spec/mongo/uri_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
let(:servers) { '%2Ftmp%2Fmongodb-27017.sock' }
353353

354354
it 'returns an array with the parsed server' do
355-
expect(uri.servers).to eq([URI.unescape(servers)])
355+
expect(uri.servers).to eq([URI::DEFAULT_PARSER.unescape(servers)])
356356
end
357357
end
358358

0 commit comments

Comments
 (0)