shelf
shelf copied to clipboard
Colon in path throws ArgumentError
Throws in: https://github.com/dart-lang/shelf/blob/fbc691a595f16d983d6e44efc9b5efbc9003645c/lib/src/request.dart#L178-L184
Because _computeUrl returns a URI with a relative path in:
https://github.com/dart-lang/shelf/blob/fbc691a595f16d983d6e44efc9b5efbc9003645c/lib/src/request.dart#L318-L320
From https://tools.ietf.org/html/rfc3986#section-3.3
In addition, a URI reference (Section 4.1) may be a relative-path reference, in which case the first path segment cannot contain a colon (":") character.
Hence, we see that Uri(path: 'a:a').path is URL-encoded, because it's a relative URL and not absolute URL unlike requestedUri which is absolute, hence, colon is not encoded in requestedUri.path, and we get an ArgumentError.
Filed a PR in https://github.com/dart-lang/shelf/pull/130
this bug has been fixed?