feat(app): the native app signs in at the web login and carries the session on its socket and downloads
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import '../../../core/session/server_session.dart';
|
||||
import 'artifact_viewer_fetch.dart';
|
||||
|
||||
/// Native fetch for an already resolved same-origin artifact.
|
||||
@@ -12,6 +13,8 @@ Future<ArtifactFetchResult> fetchArtifact(Uri uri) async {
|
||||
try {
|
||||
final request = await client.getUrl(uri);
|
||||
request.followRedirects = false;
|
||||
// A phone behind the web login carries its kept session.
|
||||
ServerSession.headers.forEach(request.headers.set);
|
||||
final response = await request.close();
|
||||
final bytes = BytesBuilder(copy: false);
|
||||
await for (final chunk in response) {
|
||||
|
||||
Reference in New Issue
Block a user