diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/OPTIONS.js b/packages/mitmproxy/src/lib/interceptor/impl/req/OPTIONS.js index 45b6c863e0..433fa24678 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/OPTIONS.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/OPTIONS.js @@ -14,7 +14,7 @@ function readConfig (config, defaultConfig) { module.exports = { name: 'options', - priority: 1, + priority: 101, requestIntercept (context, interceptOpt, req, res, ssl, next) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/cacheReq.js b/packages/mitmproxy/src/lib/interceptor/impl/req/cacheRequest.js similarity index 99% rename from packages/mitmproxy/src/lib/interceptor/impl/req/cacheReq.js rename to packages/mitmproxy/src/lib/interceptor/impl/req/cacheRequest.js index 5028002b15..cf14ea11ab 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/cacheReq.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/cacheRequest.js @@ -55,7 +55,7 @@ function getLastModifiedTimeFromIfModifiedSince (rOptions, log) { } module.exports = { - name: 'cacheReq', + name: 'cacheRequest', priority: 104, requestIntercept (context, interceptOpt, req, res, ssl, next) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/redirect.js b/packages/mitmproxy/src/lib/interceptor/impl/req/redirect.js index 93845f499c..1812abdd30 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/redirect.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/redirect.js @@ -2,7 +2,7 @@ const proxyApi = require('./proxy') module.exports = { name: 'redirect', - priority: 102, + priority: 105, requestIntercept (context, interceptOpt, req, res, ssl, next, matched) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/sni.js b/packages/mitmproxy/src/lib/interceptor/impl/req/sni.js index 782fb8a666..d2b9f7bdcb 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/sni.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/sni.js @@ -1,6 +1,6 @@ module.exports = { name: 'sni', - priority: 122, + priority: 123, requestIntercept (context, interceptOpt, req, res, ssl, next) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/success.js b/packages/mitmproxy/src/lib/interceptor/impl/req/success.js index 3991c436c3..59ee3fc9cd 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/success.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/success.js @@ -1,6 +1,6 @@ module.exports = { name: 'success', - priority: 101, + priority: 102, requestIntercept (context, interceptOpt, req, res, ssl, next) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/req/unVerifySsl.js b/packages/mitmproxy/src/lib/interceptor/impl/req/unVerifySsl.js index 6a3e863ef4..e50f7bc789 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/req/unVerifySsl.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/req/unVerifySsl.js @@ -1,6 +1,6 @@ module.exports = { name: 'unVerifySsl', - priority: 123, + priority: 124, requestIntercept (context, interceptOpt, req, res, ssl, next) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/res/cacheRes.js b/packages/mitmproxy/src/lib/interceptor/impl/res/cacheResponse.js similarity index 98% rename from packages/mitmproxy/src/lib/interceptor/impl/res/cacheRes.js rename to packages/mitmproxy/src/lib/interceptor/impl/res/cacheResponse.js index 458df35ebd..04bfa90558 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/res/cacheRes.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/res/cacheResponse.js @@ -1,7 +1,7 @@ -const cacheReq = require('../req/cacheReq') +const cacheReq = require('../req/cacheRequest') module.exports = { - name: 'cacheRes', + name: 'cacheResponse', priority: 202, responseIntercept (context, interceptOpt, req, res, proxyReq, proxyRes, ssl, next) { const { rOptions, log } = context diff --git a/packages/mitmproxy/src/lib/interceptor/impl/res/responseReplace.js b/packages/mitmproxy/src/lib/interceptor/impl/res/responseReplace.js index 1877476aba..559c8be316 100644 --- a/packages/mitmproxy/src/lib/interceptor/impl/res/responseReplace.js +++ b/packages/mitmproxy/src/lib/interceptor/impl/res/responseReplace.js @@ -1,5 +1,5 @@ const lodash = require('lodash') -const cacheReq = require('../req/cacheReq') +const cacheReq = require('../req/cacheRequest') const REMOVE = '[remove]' diff --git a/packages/mitmproxy/src/lib/interceptor/index.js b/packages/mitmproxy/src/lib/interceptor/index.js index f2d351a74d..c8255c5f1e 100644 --- a/packages/mitmproxy/src/lib/interceptor/index.js +++ b/packages/mitmproxy/src/lib/interceptor/index.js @@ -1,10 +1,9 @@ // request interceptor impls const OPTIONS = require('./impl/req/OPTIONS.js') - const success = require('./impl/req/success') -const redirect = require('./impl/req/redirect') const abort = require('./impl/req/abort') -const cacheReq = require('./impl/req/cacheReq') +const cacheRequest = require('./impl/req/cacheRequest') +const redirect = require('./impl/req/redirect') const requestReplace = require('./impl/req/requestReplace') @@ -16,20 +15,19 @@ const baiduOcr = require('./impl/req/baiduOcr') // response interceptor impls const AfterOPTIONSHeaders = require('./impl/res/AfterOPTIONSHeaders') -const cacheRes = require('./impl/res/cacheRes') +const cacheResponse = require('./impl/res/cacheResponse') const responseReplace = require('./impl/res/responseReplace') const script = require('./impl/res/script') module.exports = [ // request interceptor impls - OPTIONS, - success, redirect, abort, cacheReq, + OPTIONS, success, abort, cacheRequest, redirect, requestReplace, proxy, sni, unVerifySsl, baiduOcr, // response interceptor impls - AfterOPTIONSHeaders, cacheRes, responseReplace, + AfterOPTIONSHeaders, cacheResponse, responseReplace, script, ]