Skip to content

Commit

Permalink
feat(server): support proxy mode pass request headers (resolve #182)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuangker committed Jun 7, 2018
1 parent 909071c commit 2245dba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ module.exports = class MockController {
url: url.protocol + '//' + url.host + pathname,
params: _.assign({}, url.query, query),
data: body,
timeout: 3000
timeout: 3000,
headers: ctx.headers
}).then(res => res.data)
} catch (error) {
ctx.body = ctx.util.refail(error.message || '接口请求失败')
Expand Down

0 comments on commit 2245dba

Please sign in to comment.