Skip to content

Commit

Permalink
script.js:伪脚本地址生成规则小调整。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Apr 17, 2024
1 parent bdaad35 commit 3fde235
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mitmproxy/src/lib/interceptor/impl/res/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports = {
const script = pathConfig.script[i]
if (script.indexOf('https:') === 0 || script.indexOf('http:') === 0) {
// 绝对地址
const scriptKey = SCRIPT_PROXY_URL_PRE + script.replace('.js', '').replace(/\W/g, '') + '.js' // 伪脚本地址:移除 script 中可能存在的特殊字符,并转为相对地址
const scriptKey = SCRIPT_PROXY_URL_PRE + script.replace('.js', '').replace(/[\W_]+/g, '_') + '.js' // 伪脚本地址:移除 script 中可能存在的特殊字符,并转为相对地址
scriptProxy[scriptKey] = script
log.info(`替换script配置值:'${pathConfig.script[i]}' -> '${scriptKey}'`)
pathConfig.script[i] = scriptKey
Expand Down

0 comments on commit 3fde235

Please sign in to comment.