Skip to content

Commit f5f974d

Browse files
committed
fix: decode otp uri before parsing
1 parent ffad9a8 commit f5f974d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/otp/from_otp_uri.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ pub trait FromOtpUri: Sized {
99

1010
impl FromOtpUri for OTPElement {
1111
fn from_otp_uri(otp_uri: &str) -> color_eyre::Result<Self> {
12-
let parsed_uri = Url::parse(otp_uri).map_err(ErrReport::from)?;
12+
let decoded = urlencoding::decode(otp_uri).map_err(ErrReport::from)?;
13+
let parsed_uri = Url::parse(&decoded).map_err(ErrReport::from)?;
1314

1415
let otp_type = parsed_uri
1516
.host_str()

0 commit comments

Comments
 (0)