Fix URL spec’s handling of parameter separators. #26

pull cscott wants to merge 2 commits into bitcoin:master from cscott:patch-1 changing 1 files +4 −3
  1. cscott commented at 3:19 am on March 4, 2014: none
    Ensure that the bitcoin URL spec includes the ? or & which separate multiple bitcoinparam. Based on the examples in the rest of the spec, we assume that ? is always a reasonable separator. The & character is also allowed in non-initial positions.
  2. Fix URL spec's handling of parameter separators.
    Ensure that the bitcoin URL spec includes the `?` or `&` which separate multiple `bitcoinparam`.  Based on the examples in the rest of the spec, we assume that `?` is always a reasonable separator. The `&` character is also allowed in non-initial positions.
    54d1e9ac73
  3. laanwj commented at 7:13 am on March 4, 2014: member
    ? is only allowed in the initial position (between the address and the arguments), and & as the seperator between arguments.
  4. cscott commented at 2:14 pm on March 4, 2014: none

    The example further down in the spec uses ? as the separator between elements; I can update the patch to fix that as well.

    Modern HTML prefers using ; to & as an argument separator (no encoding issues)—should we support that as well?

  5. laanwj commented at 2:21 pm on March 4, 2014: member

    Oh? In that case I’m not sure. May be an error in the spec. Maybe mail the owners.

    Have you tested whether any of the implementations accepts ? between arguments?

  6. Use standard & and ; as separators. 6d6c4e0245
  7. cscott commented at 5:39 pm on March 4, 2014: none

    Switched to & and ;

    It would be nice to have an example with & and ; in (for example) the label text, to demonstrate proper escaping.

  8. laanwj cross-referenced this on Mar 7, 2014 from issue Fix BIP 21 and BIP 72 ambiguities & mistakes by swansontec
  9. laanwj commented at 12:15 pm on March 13, 2014: member
    I’m not sure about adding ; here as separator. Do any of the current clients allow this? Is there any reason to allow different seperators?
  10. cscott commented at 2:56 am on March 14, 2014: none

    The standard reason for recommending the use of ; is that HTML authors are notoriously bad at properly escaping & in URLs. That is, a proper bitcoin link in HTML should be:

    0<a href="bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=20.3&amp;label=Luke-Jr">Pay now</a>
    

    but almost everyone forgets to escape the & properly. See http://stackoverflow.com/questions/3481664/semicolon-as-url-query-separator for more discussion.

    The drawback is that authors now have to ensure that both & and ; in values are properly percent-encoded.

  11. laanwj commented at 3:43 am on March 14, 2014: member
    Some quick testing reveals that Qt QUrl cannot deal with ; as parameter separator. I guess in general custom code needs to be written to handle it, whereas all URI parsing libraries handle &.
  12. laanwj commented at 2:23 pm on April 29, 2014: member
    There doesn’t seem to be interest in adding ; as parameter separator. Closing this issue.
  13. laanwj closed this on Apr 29, 2014

  14. luke-jr referenced this in commit a0c4f7cfd1 on Jun 6, 2017
  15. luke-jr referenced this in commit 970b39a40d on Jun 6, 2017
  16. guggero referenced this in commit b02de55fed on Jun 23, 2022


cscott laanwj


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-04 08:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me