Skip to content

Commit

Permalink
Fix /api/archives/ handler (#7599)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfj authored Mar 27, 2024
1 parent 60583d9 commit 418931f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/lib/frontend/handlers/pubapi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PubApi {
/// clients, so while this is deprecated we need to support it indefinitely.
@EndPoint.get('/api/packages/<package>/versions/<version>/archive.tar.gz')
@EndPoint.get('/packages/<package>/versions/<version>.tar.gz')
@EndPoint.get('/api/archives/<package>-<version>.tar.gz')
@EndPoint.get('/api/archives/<package|[^-/]+>-<version>.tar.gz')
Future<Response> fetchPackage(
Request request,
String package,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/frontend/handlers/pubapi.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/test/frontend/handlers/invalid_package_url_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
expect(urls, contains('/packages/<package>/versions/<version>'));
expect(urls, contains('/api/packages/<package>'));
// this a naive assertion that fails, if new end-points are introduced!
expect(urls, hasLength(44), reason: 'check if new end-points was added');
expect(urls, hasLength(43), reason: 'check if new end-points was added');
});

testWithProfile(
Expand Down

0 comments on commit 418931f

Please sign in to comment.