4 ms·
Looking at the RFC, the grammar is not well-defined: 'opt-value' is specified as any amount of 'pchar'[0], which includes both '&' and '=' (the delimiters betw
by mattashii 6y ago
Looking at the RFC, the grammar is not well-defined:
'opt-value' is specified as any amount of 'pchar'[0], which includes both '&' and '=' (the delimiters between opts, and between opt-key and opt-values, respectively).
So in order to parse a payto-link, you either go eager and have only one option in the string, or lazy and my valid opts 'description=Food & drinks' will error out on a missing value for the ' drinks' authority-specific option, or go nuts and have parser-specific behaviour.
[0] pchar as defined in https://tools.ietf.org/html/rfc3986#appendix-A https://tools.ietf.org/html/rfc3986#appendix-A