Skip to content

Commit

Permalink
feat: change downloadUrl to future (pd4d10#38)
Browse files Browse the repository at this point in the history
* feat: change downloadUrl to future

* feat: change downloadUrl to future
  • Loading branch information
amondnet authored Nov 8, 2022
1 parent 809332c commit de8d014
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion unpub/lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class App {
}

if (packageStore.supportsDownloadUrl) {
return shelf.Response.found(packageStore.downloadUrl(name, version));
return shelf.Response.found(
await packageStore.downloadUrl(name, version));
} else {
return shelf.Response.ok(
packageStore.download(name, version),
Expand Down
4 changes: 3 additions & 1 deletion unpub/lib/src/package_store.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:async';

abstract class PackageStore {
bool supportsDownloadUrl = false;

String downloadUrl(String name, String version) {
FutureOr<String> downloadUrl(String name, String version) {
throw 'downloadUri not implemented';
}

Expand Down

0 comments on commit de8d014

Please sign in to comment.