Skip to content

Commit

Permalink
bip21: fail bip21 uri if unsupported req-* parameter is present. fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
accumulator committed Jan 4, 2024
1 parent 88058df commit 0b7fa9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions electrum/bip21.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def parse_bip21_URI(uri: str) -> dict:
for k, v in pq.items():
if len(v) != 1:
raise InvalidBitcoinURI(f'Duplicate Key: {repr(k)}')
if k.startswith('req-'):
# we have no support for any req-* query parameters
raise InvalidBitcoinURI(f'Unsupported Key: {repr(k)}')

out = {k: v[0] for k, v in pq.items()}
if address:
Expand Down

0 comments on commit 0b7fa9c

Please sign in to comment.