mirror of
https://github.com/tenrok/axios.git
synced 2026-05-30 15:24:11 +03:00
Refactored adapters loader; (#5277)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import isCancel from '../cancel/isCancel.js';
|
||||
import defaults from '../defaults/index.js';
|
||||
import CanceledError from '../cancel/CanceledError.js';
|
||||
import AxiosHeaders from '../core/AxiosHeaders.js';
|
||||
import adapters from "../adapters/adapters.js";
|
||||
|
||||
/**
|
||||
* Throws a `CanceledError` if cancellation has been requested.
|
||||
@@ -45,7 +46,7 @@ export default function dispatchRequest(config) {
|
||||
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
||||
}
|
||||
|
||||
const adapter = config.adapter || defaults.adapter;
|
||||
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
|
||||
|
||||
return adapter(config).then(function onAdapterResolution(response) {
|
||||
throwIfCancellationRequested(config);
|
||||
|
||||
Reference in New Issue
Block a user