Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

jshttp

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jshttp - npm Package Compare versions

Comparing version
0.4.0
to
0.4.1
+4
-0
CHANGELOG.md
# 版本更新说明
## v0.4.1 - 2021.05.07
1. 修复冻结配置项对象后导致重试时修改配置项出错的问题
## v0.4.0 - 2021.05.07

@@ -4,0 +8,0 @@

+0
-9

@@ -19,11 +19,2 @@ 'use strict'

ctx.request = result.request
// 冻结配置项对象,不允许再被修改
Object.freeze(ctx.config)
const list = ['headers', 'params', 'mock', 'data']
list.forEach((key) => {
if (ctx.config[key] && typeof ctx.config[key] === 'object') {
Object.freeze(ctx.config[key])
}
})
}
{
"name": "jshttp",
"version": "0.4.0",
"version": "0.4.1",
"description": "能在任何 Javascript 环境使用的 HTTP 请求库,支持 Node.js,浏览器,微信小程序,支付宝小程序,百度小程序 ...",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -208,3 +208,3 @@ # jshttp

*
* 使用 `validateStatus` 方法对响应结果进行校验,校验不通过则重试。建议配置中间件的 `ctx.retries` (当前重试次数)属性操作,当其大于 0 时,进行若干操作。
* 使用 `validateStatus` 方法对响应结果进行校验,校验不通过则重试。建议配合中间件的 `ctx.retries` (当前重试次数)属性操作,当其大于 0 时,进行若干操作。
*/

@@ -211,0 +211,0 @@ retry: 0,