Преглед на файлове

Merge pull request #3738 from swagger-api/ft/spec-download-interception

Pass configuration interceptors to spec download fetch
bubble
kyle преди 7 години
committed by GitHub
родител
ревизия
1e146627d2
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. +4
    -1
      src/core/plugins/download-url.js

+ 4
- 1
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,*/*"


Зареждане…
Отказ
Запис