From 74165f5292258b94896d8b38536571c8892e206b Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Mon, 9 Oct 2017 12:10:41 -0700 Subject: [PATCH] Pass configuration interceptors to spec download fetch --- src/core/plugins/download-url.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/plugins/download-url.js b/src/core/plugins/download-url.js index c8dff0b8..d80e982b 100644 --- a/src/core/plugins/download-url.js +++ b/src/core/plugins/download-url.js @@ -7,13 +7,16 @@ export default function downloadUrlPlugin (toolbox) { let { fn } = toolbox const actions = { - download: (url)=> ({ errActions, specSelectors, specActions }) => { + download: (url)=> ({ errActions, specSelectors, specActions, getConfigs }) => { let { fetch } = fn + const config = getConfigs() url = url || specSelectors.url() specActions.updateLoadingStatus("loading") fetch({ url, loadSpec: true, + requestInterceptor: config.requestInterceptor || (a => a), + responseInterceptor: config.responseInterceptor || (a => a), credentials: "same-origin", headers: { "Accept": "application/json,*/*"