mirror of
https://gitea.com/actions/setup-deno.git
synced 2025-12-15 04:46:42 +00:00
chore: migrate code to ESM (#73)
This commit is contained in:
21
node_modules/undici/lib/interceptor/redirectInterceptor.js
generated
vendored
21
node_modules/undici/lib/interceptor/redirectInterceptor.js
generated
vendored
@@ -1,21 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const RedirectHandler = require('../handler/RedirectHandler')
|
||||
|
||||
function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
|
||||
return (dispatch) => {
|
||||
return function Intercept (opts, handler) {
|
||||
const { maxRedirections = defaultMaxRedirections } = opts
|
||||
|
||||
if (!maxRedirections) {
|
||||
return dispatch(opts, handler)
|
||||
}
|
||||
|
||||
const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
|
||||
opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
|
||||
return dispatch(opts, redirectHandler)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = createRedirectInterceptor
|
||||
Reference in New Issue
Block a user