@useoptic/cli-config
Advanced tools
Comparing version 9.0.13 to 9.0.15
@@ -5,4 +5,4 @@ "use strict"; | ||
exports.defaultIgnoreRules = [ | ||
'OPTIONS *', | ||
'HEAD *', | ||
'OPTIONS (.*)', | ||
'HEAD (.*)', | ||
'GET (.*).htm', | ||
@@ -9,0 +9,0 @@ 'GET (.*).html', |
@@ -49,11 +49,17 @@ "use strict"; | ||
} | ||
const regex = path_to_regexp_1.default(pathInput); | ||
const shouldIgnore = (method, url) => methods.includes(method) && regex.exec(url) !== null; | ||
return { | ||
methods, | ||
path: pathInput, | ||
regex, | ||
shouldIgnore, | ||
}; | ||
try { | ||
const regex = path_to_regexp_1.default(pathInput); | ||
const shouldIgnore = (method, url) => methods.includes(method) && regex.exec(url) !== null; | ||
return { | ||
methods, | ||
path: pathInput, | ||
regex, | ||
shouldIgnore, | ||
}; | ||
} | ||
catch (e) { | ||
console.warn('Invalid regex in ignore rule, skipping:' + userInput); | ||
return undefined; | ||
} | ||
} | ||
exports.parseRule = parseRule; |
@@ -83,2 +83,3 @@ import { parseRule, parseIgnore, IIgnoreRunnable } from './helpers/ignore-parser'; | ||
command?: string; | ||
hostnameFilter?: string; | ||
serviceConfig: { | ||
@@ -85,0 +86,0 @@ port: number; |
@@ -124,4 +124,8 @@ "use strict"; | ||
}; | ||
const hostnameFilter = targetUrl | ||
? targetUrl.hostname | ||
: undefined; | ||
return { | ||
command: task.command, | ||
hostnameFilter, | ||
serviceConfig, | ||
@@ -128,0 +132,0 @@ proxyConfig, |
{ | ||
"name": "@useoptic/cli-config", | ||
"version": "9.0.13", | ||
"version": "9.0.15", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "ws:test": "jest", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32133
683