Skip to content

Commit 3e4890f

Browse files
authored
Set the content type during publish to application/gzip (#1671)
Fixes dart-lang/pub-dev#230
1 parent b712a5e commit 3e4890f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/command/lish.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'dart:async';
66

77
import 'package:http/http.dart' as http;
8+
import 'package:http_parser/http_parser.dart' as http_parser;
89

910
import '../ascii_tree.dart' as tree;
1011
import '../command.dart';
@@ -87,7 +88,9 @@ class LishCommand extends PubCommand {
8788
request.followRedirects = false;
8889
request.files.add(new http.MultipartFile.fromBytes(
8990
'file', packageBytes,
90-
filename: 'package.tar.gz'));
91+
filename: 'package.tar.gz',
92+
contentType: new http_parser.MediaType('application', 'gzip')));
93+
9194
var postResponse =
9295
await http.Response.fromStream(await client.send(request));
9396

0 commit comments

Comments
 (0)