Skip to content

Commit

Permalink
Merge pull request #3738 from swagger-api/ft/spec-download-interception
Browse files Browse the repository at this point in the history
Pass configuration interceptors to spec download fetch
  • Loading branch information
shockey authored Oct 10, 2017
2 parents f11ab53 + 37aead9 commit 1e14662
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/plugins/download-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,*/*"
Expand Down

0 comments on commit 1e14662

Please sign in to comment.