File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ pub enum InvoiceParseError {
75
75
/// invalid invoice.
76
76
Invalid ,
77
77
78
+ /// RGB invoice must not contain any URI authority data, including empty
79
+ /// one.
80
+ Authority ,
81
+
78
82
/// contract id is missed from the invoice.
79
83
ContractMissed ,
80
84
@@ -349,7 +353,12 @@ impl FromStr for RgbInvoice {
349
353
return Err ( InvoiceParseError :: InvalidScheme ( scheme. to_string ( ) ) ) ;
350
354
}
351
355
352
- let mut path = uri. path ( ) . segments ( ) ;
356
+ let path = uri. path ( ) ;
357
+ if path. is_absolute ( ) || uri. auth . is_some ( ) {
358
+ return Err ( InvoiceParseError :: Authority ) ;
359
+ }
360
+
361
+ let mut path = path. segments ( ) ;
353
362
354
363
let Some ( contract_id_str) = path. next ( ) else {
355
364
return Err ( InvoiceParseError :: ContractMissed ) ;
You can’t perform that action at this time.
0 commit comments