google / google/uri.dart

Extra junk in url's produced by UriMatch.match

Open
#16 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
80
Forks
42
PR merge metrics
No merged PRs in 30d

Description

```
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.