diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-02-03 15:27:26 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-02-03 15:27:26 +0100 |
commit | a2628b43bbfe4368a3b5963e8b80eb6f463d94c3 (patch) | |
tree | c72b9fa978113ea550e20ae0b00e3829f4bdf25a /src/libexpr/flake/flakeref.cc | |
parent | d070e1c5321b43496f1113198e62b2b647433459 (diff) |
Fix URL parser
Fixes #3062.
Diffstat (limited to 'src/libexpr/flake/flakeref.cc')
-rw-r--r-- | src/libexpr/flake/flakeref.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc index a34d766d7..c46661df8 100644 --- a/src/libexpr/flake/flakeref.cc +++ b/src/libexpr/flake/flakeref.cc @@ -67,8 +67,10 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment( { using namespace fetchers; + static std::string fnRegex = "[0-9a-zA-Z-._~!$&'\"()*+,;=]+"; + static std::regex pathUrlRegex( - "(" + pathRegex + "/?)" + "(/?" + fnRegex + "(?:/" + fnRegex + ")*/?)" + "(?:\\?(" + queryRegex + "))?" + "(?:#(" + queryRegex + "))?", std::regex::ECMAScript); |