MCPcopy Index your code
hub / github.com/dataease/SQLBot / downloadUrlPlugin

Function downloadUrlPlugin

frontend/public/swagger-ui-bundle.js:57206–57301  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

57204 { rootInjects: u }
57205 )
57206 }
57207 function downloadUrlPlugin(s) {
57208 let { fn: o } = s
57209 const i = {
57210 download:
57211 (s) =>
57212 ({ errActions: i, specSelectors: a, specActions: u, getConfigs: _ }) => {
57213 let { fetch: w } = o
57214 const x = _()
57215 function next(o) {
57216 if (o instanceof Error || o.status >= 400)
57217 return (
57218 u.updateLoadingStatus('failed'),
57219 i.newThrownErr(
57220 Object.assign(new Error((o.message || o.statusText) + ' ' + s), {
57221 source: 'fetch',
57222 })
57223 ),
57224 void (
57225 !o.status &&
57226 o instanceof Error &&
57227 (function checkPossibleFailReasons() {
57228 try {
57229 let o
57230 if (
57231 ('URL' in lt
57232 ? (o = new URL(s))
57233 : ((o = document.createElement('a')), (o.href = s)),
57234 'https:' !== o.protocol && 'https:' === lt.location.protocol)
57235 ) {
57236 const s = Object.assign(
57237 new Error(
57238 `Possible mixed-content issue? The page was loaded over https:// but a ${o.protocol}// URL was specified. Check that you are not attempting to load mixed content.`
57239 ),
57240 { source: 'fetch' }
57241 )
57242 return void i.newThrownErr(s)
57243 }
57244 if (o.origin !== lt.location.origin) {
57245 const s = Object.assign(
57246 new Error(
57247 `Possible cross-origin (CORS) issue? The URL origin (${o.origin}) does not match the page (${lt.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`
57248 ),
57249 { source: 'fetch' }
57250 )
57251 i.newThrownErr(s)
57252 }
57253 } catch (s) {
57254 return
57255 }
57256 })()
57257 )
57258 )
57259 ;(u.updateLoadingStatus('success'),
57260 u.updateSpec(o.text),
57261 a.url() !== s && u.updateUrl(s))
57262 }
57263 ;((s = s || a.url()),

Callers

nothing calls this directly

Calls 8

UtFunction · 0.85
errorMethod · 0.80
_Function · 0.70
wFunction · 0.70
getMethod · 0.65
urlMethod · 0.45
thenMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected