[web] Use 'Uri' instead of 'dart:html' to extract pathname (#127983)
- Use `Uri.parse()` to extract pathname. - Remove unused code from `utils.dart`. - Add test for URL encoding. (need to wait for https://github.com/flutter/flutter/pull/126851 to make it into Google3)
This commit is contained in:
@@ -33,5 +33,9 @@ void main() {
|
||||
expect(extractPathname('https://example.com/foo'), '/foo');
|
||||
expect(extractPathname('https://example.com/foo#bar'), '/foo');
|
||||
expect(extractPathname('https://example.com/foo/#bar'), '/foo/');
|
||||
|
||||
// URL encoding.
|
||||
expect(extractPathname('/foo bar'), '/foo%20bar');
|
||||
expect(extractPathname('https://example.com/foo bar'), '/foo%20bar');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user