Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions app/lib/package/api_export/exported_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ final class ExportedPackage {
/// Interace for writing `/api/archives/<package>-<version>.tar.gz`.
ExportedBlob tarball(String version) => ExportedBlob._(
_owner,
'/api/archives/$_package-${Uri.encodeComponent(version)}.tar.gz',
'/api/archives/$_package-$version.tar.gz',
'$_package-$version.tar.gz',
'application/octet',
Duration(hours: 2),
Expand Down Expand Up @@ -313,9 +313,7 @@ final class ExportedPackage {
);
return;
}
final version = Uri.decodeComponent(
item.name.without(prefix: pfx, suffix: '.tar.gz'),
);
final version = item.name.without(prefix: pfx, suffix: '.tar.gz');

final info = versions[version];
if (info != null && !forceWrite) {
Expand Down Expand Up @@ -373,7 +371,7 @@ final class ExportedPackage {
return;
}
final version = item.name.without(prefix: pfx, suffix: '.tar.gz');
if (allVersionNumbers.contains(Uri.decodeComponent(version))) {
if (allVersionNumbers.contains(version)) {
return;
}
if (await _owner._bucket.tryInfo(item.name) case final info?) {
Expand Down
8 changes: 4 additions & 4 deletions app/test/package/api_export/exported_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void main() {
[1, 2, 3],
);
expect(
await bucket.readBytes('latest/api/archives/_foo-1.2.3-dev%2B2.tar.gz'),
await bucket.readBytes('latest/api/archives/_foo-1.2.3-dev+2.tar.gz'),
[1, 2, 3],
);
expect(
Expand All @@ -184,7 +184,7 @@ void main() {
);
expect(
await bucket
.readBytes('latest/api/archives/_foo-1.2.3-d%2B4.tar.gz.tar.gz'),
.readBytes('latest/api/archives/_foo-1.2.3-d+4.tar.gz.tar.gz'),
[42],
);
});
Expand Down Expand Up @@ -309,7 +309,7 @@ void main() {
[2, 0, 0],
);
expect(
await bucket.readBytes('latest/api/archives/retry-3.0.0%2B1.tar.gz'),
await bucket.readBytes('latest/api/archives/retry-3.0.0+1.tar.gz'),
[3, 0, 0],
);

Expand All @@ -333,7 +333,7 @@ void main() {
[2, 0, 0],
);
expect(
await bucket.readBytes('latest/api/archives/retry-3.0.0%2B1.tar.gz'),
await bucket.readBytes('latest/api/archives/retry-3.0.0+1.tar.gz'),
[3, 0, 0],
);
});
Expand Down
Loading