12345678910111213141516171819202122232425262728293031 |
- 'use strict';
-
- const path = require('path');
-
- function isUrlRequest(url, root) {
-
-
-
- if (/^[a-z][a-z0-9+.-]*:/i.test(url) && !path.win32.isAbsolute(url)) {
- return false;
- }
-
-
- if (/^\/\//.test(url)) {
- return false;
- }
-
-
- if (/^[{}[\]#*;,'§$%&(=?`´^°<>]/.test(url)) {
- return false;
- }
-
-
- if ((root === undefined || root === false) && /^\//.test(url)) {
- return false;
- }
-
- return true;
- }
-
- module.exports = isUrlRequest;
|