...
|
...
|
@@ -19,7 +19,7 @@ const _ = require('lodash'); |
|
|
*/
|
|
|
const safeRedirect = (uri) => {
|
|
|
let formalUrl = url.parse(uri); // 匹配标准的URL
|
|
|
let informalUrl = uri.match(/^\/\/(.*?)\//); // 尝试匹配 '//' 开头的不规范的URL
|
|
|
let informalUrl = uri.match(/^\/\/([\w\d\-.]+).*/); // 尝试匹配 '//' 开头的不规范的URL
|
|
|
let matchFunc;
|
|
|
|
|
|
if (formalUrl.protocol) {
|
...
|
...
|
|