From 711f3efc374ed2314772bd35545ed28ef5465ae8 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Wed, 19 Jul 2017 07:31:31 -0700 Subject: [PATCH] Set the content type during publish to application/gzip Fixes https://github.com/dart-lang/pub-dartlang-dart/issues/230 --- lib/src/command/lish.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/command/lish.dart b/lib/src/command/lish.dart index cceee423b..3f4401581 100644 --- a/lib/src/command/lish.dart +++ b/lib/src/command/lish.dart @@ -5,6 +5,7 @@ import 'dart:async'; import 'package:http/http.dart' as http; +import 'package:http_parser/http_parser.dart' as http_parser; import '../ascii_tree.dart' as tree; import '../command.dart'; @@ -87,7 +88,9 @@ class LishCommand extends PubCommand { request.followRedirects = false; request.files.add(new http.MultipartFile.fromBytes( 'file', packageBytes, - filename: 'package.tar.gz')); + filename: 'package.tar.gz', + contentType: new http_parser.MediaType('application', 'gzip'))); + var postResponse = await http.Response.fromStream(await client.send(request));