-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fragment parameter case sensitivity #446
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12528347962Details
💛 - Coveralls |
c071745
to
4cc0396
Compare
payjoin/src/uri/url_ext.rs
Outdated
@@ -103,8 +103,8 @@ where | |||
{ | |||
if let Some(fragment) = url.fragment() { | |||
for param in fragment.split('+') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fragment.to_oppercase()
instead of param
? seems a bit more intuitive to me, and only needs to be done once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've addressed this and chosen a function chain approach rather than nested conditional statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utack, sorry for not doing this myself when it came up
4cc0396
to
d3f1e1b
Compare
Bech32 fragment parameters should not be case sensitive. This fixes that by converting params and bech32 Hrp|'1' prefixes they match against to uppercase. Note that this implementation implies all fragment parameters must be case insentitive, which needs to be specified in BIP 77. Close payjoin#442
d3f1e1b
to
dfaf948
Compare
On second pass I realize this change constrains fragment parameters to case insensitivity. BIP 77 is going to need to specify that, and IMO must specify params are bech32 encoded to minimize dependency requirements and QR size |
bbmobile's bitcoin URI logic has bugs, and it lowercases the URI in display and for clipboard, so we end up with a lowercased URL to parse in the |
ouch... that's incompatible with RFC 3986 FWIW. RFC 3986 section 6.2.2.1 says case insensitive fields should be lowercased, e.g. scheme, host, but that's not a requirement, so QR alphanumerical encoding seems reasonable, and that % encoding should be uppercased, which they are. and:
|
and would break if a directory has a path element, see #416 |
We're set to resolve this by
I believe this issue itself is wontfix |
Bech32 fragment parameters should not be case sensitive. This fixes that by converting params and bech32 HRPs they match against to uppercase.
Close #442
--
Depends on lint fixes from #447