File: remove-cgi-parse.patch

package info (click to toggle)
ruby-rotp 6.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: ruby: 1,020; makefile: 16
file content (47 lines) | stat: -rw-r--r-- 1,742 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: spec: replace CGI.parse with URI.decode_www_form
Author: Simon Quigley <tsimonq2@debian.org>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-02-26
---
This patch header follows DEP-3: https://dep.debian.net/deps/dep3/
--- a/spec/lib/rotp/hotp_spec.rb
+++ b/spec/lib/rotp/hotp_spec.rb
@@ -110,7 +110,7 @@ RSpec.describe ROTP::HOTP do
 
   describe '#provisioning_uri' do
     let(:hotp) { ROTP::HOTP.new('a' * 32, name: "m@mdp.im") }
-    let(:params) { CGI.parse URI.parse(uri).query }
+    let(:params) { URI.decode_www_form(URI.parse(uri).query || "").to_h }
 
     it 'created from the otp instance data' do
       expect(hotp.provisioning_uri())
@@ -132,7 +132,7 @@ RSpec.describe ROTP::HOTP do
       let(:uri)    { hotp.provisioning_uri("mark@percival") }
 
       it 'includes the issuer as parameter' do
-        expect(params['image'].first).to eq 'https://example.com/icon.png'
+        expect(params['image']).to eq 'https://example.com/icon.png'
       end
     end
 
--- a/spec/lib/rotp/totp_spec.rb
+++ b/spec/lib/rotp/totp_spec.rb
@@ -223,7 +223,7 @@ RSpec.describe ROTP::TOTP do
 
 
   describe '#provisioning_uri' do
-    let(:params) { CGI.parse URI.parse(uri).query }
+    let(:params) { URI.decode_www_form(URI.parse(uri).query || "").to_h }
 
     context "with a provided name on the TOTP instance" do
       let(:totp) { ROTP::TOTP.new(TEST_SECRET, name: "m@mdp.im") }
@@ -247,7 +247,7 @@ RSpec.describe ROTP::TOTP do
       let(:uri)    { totp.provisioning_uri("mark@percival") }
 
       it 'includes the issuer as parameter' do
-        expect(params['image'].first).to eq 'https://example.com/icon.png'
+        expect(params['image']).to eq 'https://example.com/icon.png'
       end
 
     end