httpquick 1.1.0 → 1.1.1

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/dist/fibjs.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./HttpQuickBase-D0-rw_KI.cjs"),i=require("http"),n=require("util");class d extends u.HttpQuickBase{send(e,s){try{const t=i.request(e.method,e.fullUrl,{headers:e.headers,body:e.body||""});if(t.status!==200)return this.onNetworkError(e,s,null);s.status=t.statusCode,s.statusText=t.statusMessage;for(let a of t.headers.keys()){let o=t.headers.first(a);a=a.toLowerCase();for(const r of o)s.headers[a]=r}e.responseType=="text"&&e.dataType=="json"?s.body=Buffer.isBuffer(t.data)?JSON.parse(t.data.toString("utf8")):typeof t.data=="string"?JSON.parse(t.data):t.data:e.responseType=="text"?s.body=t.data.toString("utf8"):s.body=t.data}catch(t){return this.onTimeoutError(e,s,t)}}request(e){return n.sync(async s=>await super.request(s))(e)}}exports.HttpQuickFibjs=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./HttpQuickBase-D0-rw_KI.cjs"),n=require("http"),d=require("util");class i extends u.HttpQuickBase{send(e,s){try{const t=n.request(e.method,e.fullUrl,{headers:e.headers,body:e.body||""});if(t.status!==200)return this.onNetworkError(e,s,null);s.status=t.statusCode,s.statusText=t.statusMessage;for(let a of t.headers.keys()){const o=t.headers.all(a);a=a.toLowerCase();for(const r of o)s.headers[a]=r}e.responseType=="text"&&e.dataType=="json"?s.body=Buffer.isBuffer(t.data)?JSON.parse(t.data.toString("utf8")):typeof t.data=="string"?JSON.parse(t.data):t.data:e.responseType=="text"?s.body=t.data.toString("utf8"):s.body=t.data}catch(t){return this.onTimeoutError(e,s,t)}}request(e){return d.sync(async s=>await super.request(s))(e)}}exports.HttpQuickFibjs=i;
package/dist/fibjs.js CHANGED
@@ -13,7 +13,7 @@ class y extends u {
13
13
  return this.onNetworkError(e, s, null);
14
14
  s.status = t.statusCode, s.statusText = t.statusMessage;
15
15
  for (let a of t.headers.keys()) {
16
- let o = t.headers.first(a);
16
+ const o = t.headers.all(a);
17
17
  a = a.toLowerCase();
18
18
  for (const r of o)
19
19
  s.headers[a] = r;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "httpquick",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "js http quick request",
5
5
  "author": "dotcoo <dotcoo@163.com> (http://blog.dotcoo.com)",
6
6
  "homepage": "https://github.com/dotcoo/httpquick#readme",