Skip to content

Commit

Permalink
chore(dep): update mime version to ^2.0.0 (#5568)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikaHsn authored Oct 18, 2024
1 parent ace278e commit 6e6edab
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dev_dependencies:
checks: ^0.3.0
cli_script: ^0.3.0
io: ^1.0.0
mime: ^1.0.0
mime: ">=1.0.0 <3.0.0"
path: ">=1.8.0 <2.0.0"
shelf: ^1.4.0
test: ^1.22.1
Expand Down
2 changes: 1 addition & 1 deletion packages/aws_common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
json_annotation: ">=4.9.0 <4.10.0"
logging: ^1.0.0
meta: ^1.7.0
mime: ^1.0.0
mime: ">=1.0.0 <3.0.0"
os_detect: ^2.0.2
path: ">=1.8.0 <2.0.0"
stream_transform: ^2.0.0
Expand Down
13 changes: 10 additions & 3 deletions packages/test/pub_server/lib/src/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:pub_server/src/database.dart';
import 'package:pub_server/src/models.dart';
import 'package:pubspec_parse/pubspec_parse.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf_multipart/form_data.dart';
import 'package:shelf_multipart/shelf_multipart.dart';
import 'package:shelf_router/shelf_router.dart';

part 'server.g.dart';
Expand Down Expand Up @@ -146,15 +146,22 @@ class PubServer {
/// https:/dart-lang/pub/blob/master/doc/repository-spec-v2.md#publishing-packages
@Route.post('/api/packages/versions/newUpload')
Future<Response> upload(Request request) async {
if (!request.isMultipartForm) {
if (request.multipart() == null) {
return Response.badRequest(
body: 'Expected multipart request',
);
}

final formDataRequest = request.formData();
if (formDataRequest == null) {
return Response.badRequest(
body: 'Expected multipart request to contain form data',
);
}

final FormData packageTar;
try {
packageTar = await request.multipartFormData.singleWhere(
packageTar = await formDataRequest.formData.singleWhere(
(part) => part.filename == 'package.tar.gz',
);
} on StateError {
Expand Down
2 changes: 1 addition & 1 deletion packages/test/pub_server/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
pub_semver: ^2.1.3
pubspec_parse: ^1.2.2
shelf: ^1.4.0
shelf_multipart: ^1.0.0
shelf_multipart: ^2.0.0
shelf_router: ^1.1.3
yaml: ^3.1.1

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies:
intl: ">=0.18.0 <1.0.0"
json_annotation: ">=4.9.0 <4.10.0"
json_serializable: 6.8.0
mime: ^1.0.0
mime: ">=1.0.0 <3.0.0"
oauth2: ^2.0.2
package_info_plus: ^8.0.0
pigeon: ^11.0.0
Expand Down

0 comments on commit 6e6edab

Please sign in to comment.