1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-18 19:22:54 +01:00

fix(github): encode url

This commit is contained in:
Rongjian Zhang 2020-01-31 13:53:17 +08:00
parent 89c311c410
commit 16925f8e1a

View File

@ -80,8 +80,8 @@ class ObjectScreen extends StatelessWidget {
if (['pdf', 'docx', 'doc', 'pptx', 'ppt', 'xlsx', 'xls']
.contains(ext)) {
// Let system browser handle these files
url =
'https://raw.githubusercontent.com/$owner/$name/$branch/$path';
url = Uri.encodeFull(
'https://raw.githubusercontent.com/$owner/$name/$branch/$path');
} else {
url =
'/$owner/$name/blob/$branch?path=${p.join(_pathNotNull, v.name).urlencode}';
@ -103,8 +103,8 @@ class ObjectScreen extends StatelessWidget {
return BlobView(
path,
text: (data as GhObjectBlob).text,
networkUrl:
'https://raw.githubusercontent.com/$owner/$name/$branch/$path', // TODO: private
networkUrl: Uri.encodeFull(
'https://raw.githubusercontent.com/$owner/$name/$branch/$path'), // TODO: private
);
default:
return null;