OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
swagger-ui-5.17.14
/
src
/
core
/
config
/
sources
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 04:34:06 AM
rwxr-xr-x
📄
query.js
716 bytes
08/07/2024 04:34:06 AM
rw-r--r--
📄
runtime.js
445 bytes
08/07/2024 04:34:06 AM
rw-r--r--
📄
url.js
904 bytes
08/07/2024 04:34:06 AM
rw-r--r--
Editing: url.js
Close
/** * @prettier * Receives options from a remote URL. */ const makeDeferred = () => { const deferred = {} deferred.promise = new Promise((resolve, reject) => { deferred.resolve = resolve deferred.reject = reject }) return deferred } const optionsFromURL = ({ url, system }) => async (options) => { if (!url) return {} if (typeof system.configsActions?.getConfigByUrl !== "function") return {} const deferred = makeDeferred() const callback = (fetchedOptions) => { // receives null on remote URL fetch failure deferred.resolve(fetchedOptions) } system.configsActions.getConfigByUrl( { url, loadRemoteConfig: true, requestInterceptor: options.requestInterceptor, responseInterceptor: options.responseInterceptor, }, callback ) return deferred.promise } export default optionsFromURL