Transfer URIs instead of platform-dependent file paths (#8701)
This commit is contained in:
committed by
GitHub
parent
34ed3d2d24
commit
03d3186531
@@ -1 +1 @@
|
||||
6e54f5e31f084d2e54a510959f68b89e4d2fdffd
|
||||
e0c702e35300b7fdef975b9929df25e112fa9eda
|
||||
|
||||
@@ -199,8 +199,7 @@ class ServiceProtocolDevFSOperations implements DevFSOperations {
|
||||
'_writeDevFSFile',
|
||||
params: <String, dynamic> {
|
||||
'fsName': fsName,
|
||||
// TODO(goderbauer): transfer real Uri (instead of file path) when remote end supports it
|
||||
'path': deviceUri.toFilePath(windows: false),
|
||||
'uri': deviceUri.toString(),
|
||||
'fileContents': fileContents
|
||||
},
|
||||
);
|
||||
@@ -268,9 +267,8 @@ class _DevFSHttpWriter {
|
||||
final HttpClientRequest request = await _client.putUrl(httpAddress);
|
||||
request.headers.removeAll(HttpHeaders.ACCEPT_ENCODING);
|
||||
request.headers.add('dev_fs_name', fsName);
|
||||
// TODO(goderbauer): transfer real Uri (instead of file path) when remote end supports it
|
||||
request.headers.add('dev_fs_path_b64',
|
||||
BASE64.encode(UTF8.encode(deviceUri.toFilePath(windows: false))));
|
||||
request.headers.add('dev_fs_uri_b64',
|
||||
BASE64.encode(UTF8.encode(deviceUri.toString())));
|
||||
final Stream<List<int>> contents = content.contentsAsCompressedStream();
|
||||
await request.addStream(contents);
|
||||
final HttpClientResponse response = await request.close();
|
||||
|
||||
@@ -299,7 +299,7 @@ class MockVMService extends BasicMock implements VMService {
|
||||
_httpAddress = Uri.parse('http://127.0.0.1:${_server.port}');
|
||||
_server.listen((HttpRequest request) {
|
||||
final String fsName = request.headers.value('dev_fs_name');
|
||||
final String devicePath = UTF8.decode(BASE64.decode(request.headers.value('dev_fs_path_b64')));
|
||||
final String devicePath = UTF8.decode(BASE64.decode(request.headers.value('dev_fs_uri_b64')));
|
||||
messages.add('writeFile $fsName $devicePath');
|
||||
request.drain<List<int>>().then<Null>((List<int> value) {
|
||||
request.response
|
||||
|
||||
Reference in New Issue
Block a user