mirror of
https://github.com/SickleSec/SnowEyes.git
synced 2026-10-29 03:40:48 +00:00
19 lines
441 B
JavaScript
19 lines
441 B
JavaScript
const apiValidator = (function() {
|
|
return {
|
|
isNotFullUrl(path) {
|
|
return !/^(?:https?:)?\/\/[^\/]+/.test(path);
|
|
},
|
|
|
|
isNotStaticResource(path) {
|
|
return !API_CONFIG.STATIC_PATTERNS.some(pattern => pattern.test(path));
|
|
},
|
|
|
|
isValidPath(path) {
|
|
return path.length >= 3 &&
|
|
path.length <= 300 &&
|
|
/^\/[\w\-\.\/\@]+/.test(path);
|
|
}
|
|
};
|
|
})();
|
|
|
|
window.apiValidator = apiValidator;
|