Skip to content

Extra junk in url's produced by UriMatch.match #16

@Andersmholmgren

Description

@Andersmholmgren
  final p = new UriParser(new UriTemplate('/ui'));
  final match = p.match(Uri.parse('http://localhost:8080/ui/foo'));
  print(match.rest);

Expected

/foo

Actual

///foo?#

Cause
UriMatch builds (via UriBuilder) a uri with '' rather than null in fragment and host, plus an empty map for queryParameters.
Uri.toString() assume all those are null or have something interesting in them.

Note: I would consider it a bug in Uri to required null queryParameters as empty collections are normally considered better practice than null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions