mm_https 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -30,7 +30,7 @@ class Http {
30
30
  'Accept-Language': 'zh-CN,zh;q=0.9',
31
31
  'Cache-Control': 'no-cache',
32
32
  'Connection': 'keep-alive',
33
- 'Pragma': 'no-cache',
33
+ // 'Pragma': 'no-cache',
34
34
  // 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"',
35
35
  // 'sec-ch-ua-mobile': '?0',
36
36
  // 'sec-ch-ua-platform': '"Windows"',
@@ -283,7 +283,8 @@ Http.prototype.request = function(options) {
283
283
  case 'br':
284
284
  case 'gzip':
285
285
  case 'deflate':
286
- body = unzipSync(buffer).toString();
286
+ buffer = unzipSync(buffer);
287
+ body = buffer.toString();
287
288
  break;
288
289
  default:
289
290
  body = buffer.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_https",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "这是超级美眉http请求帮助类模块,可自动补充cookie,实现模拟登录,通讯",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test.js CHANGED
@@ -2,11 +2,11 @@
2
2
  var Http = require('./index.js');
3
3
  var fs = require("fs");
4
4
 
5
- async function test(){
6
- var http = new Http();
7
- var res = await http.get("https://www.baidu.com/");
8
- console.log("html", res);
9
- }
5
+ // async function test(){
6
+ // var http = new Http();
7
+ // var res = await http.get("https://www.baidu.com/");
8
+ // console.log("html", res);
9
+ // }
10
10
 
11
11
  // async function test3() {
12
12
  // // 将「微信对话开放平台」得到的信息填入
@@ -140,16 +140,15 @@ async function test(){
140
140
  // test();
141
141
 
142
142
 
143
- // async function download(){
144
- // var hp = new Http();
145
- // // var url = "http://www.haoduoma.com/d/file/p/2021-06-18/76df67e451ca9dec9991588ad7fda6e6.jpg";
146
- // var url = "https://www.copipi.com/p/224/224/becce1fc21d723614b598f5377d5d676.jpg";
147
- // "./二维码/中文".addDir();
148
- // var filename = "./二维码/你好.jpg".fullname();
149
- // var file = await hp.download(url, filename);
150
- // console.log(file);
151
- // }
152
- // download();
143
+ async function download(){
144
+ var hp = new Http();
145
+ var url = "https://www.copipi.com/p/224/224/becce1fc21d723614b598f5377d5d676.jpg";
146
+ "./二维码/中文".addDir();
147
+ var filename = "./二维码/qrcode.jpg".fullname();
148
+ var file = await hp.download(url, filename);
149
+ console.log(file);
150
+ }
151
+ download();
153
152
 
154
153
  // async function test() {
155
154
  // var http = new Http();
@@ -205,4 +204,4 @@ async function test(){
205
204
  // // console.log("结果", res.body);
206
205
  // }
207
206
 
208
- test();
207
+ // test();