Skip to content

Commit af14450

Browse files
committed
Merge pull request #47 from ivanvoznyakovsky/fix-http-copy-config
perf(http): speed up preparation of http config with large payload
2 parents 2fba1ee + 6959eb0 commit af14450

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ class DSHttpAdapter {
121121
HTTP (config) {
122122
let _this = this
123123
let start = new Date()
124-
config = copy(config)
125-
config = deepMixIn(config, _this.defaults.httpConfig)
124+
125+
// blacklist `data` as it can be large and will take a lot of time to copy
126+
let payload = config.data
127+
config = copy(config, null, null, null, ['data'])
128+
config = deepMixIn(config, _this.defaults.httpConfig, {data: payload})
126129
if (!('verbsUseBasePath' in config)) {
127130
config.verbsUseBasePath = _this.defaults.verbsUseBasePath
128131
}

0 commit comments

Comments
 (0)