Skip to content
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

AddBroker: Escape % in Addresses #319

Merged
merged 1 commit into from Jul 17, 2019
Merged

AddBroker: Escape % in Addresses #319

merged 1 commit into from Jul 17, 2019

Commits on May 27, 2019

  1. AddBroker: Escape % in Addresses

    The url.Parse(server) will fail if given an address containing a
    non escaped % which is the case for an IPv6 address with a zone
    indication.
    
    Ex.
    [fe80::a604:5838:8d8a:e532%wlp58s0]:1883 => [fe80::a604:5838:8d8a:e532%25wlp58s0]:1883
    
    Regexp explanation:
    `%(25)?`
    % - Match % literally (case sensitive)
    (25)? -  Match 25 literally between zero and one time.
    
    => Will match any % followed by 25 or not.
    The Regexp.ReplaceAll(...) will replace all matches of the regular
    expression above and replace them with %25. Which is the URL escape code
    for %.
    
    Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
    Mattemagikern committed May 27, 2019
    Configuration menu
    Copy the full SHA
    bb7927e View commit details
    Browse the repository at this point in the history