mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-24 23:59:16 -04:00
Actually use certificate.disabled property
This commit is contained in:
1 parent
5e6dd09652
commit
041d333be7
2 files changed
+10
-5
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import {parse as urlParse} from 'url';
|
||||
|
||||
const WILDCARD_CHARACTER = '*';
|
||||
const WILDCARD_SUBSTITUTION = Math.random().toString().split('.')[1];
|
||||
const WILDCARD_SUBSTITUTION_PATTERN = new RegExp(`${WILDCARD_SUBSTITUTION}`, 'g');
|
||||
@@ -8,18 +9,18 @@ export default function certificateUrlParse (url) {
|
||||
return urlParse(url);
|
||||
} else {
|
||||
const parsed = urlParse(url.replace(/\*/g, WILDCARD_SUBSTITUTION));
|
||||
parsed.hostname = reinstateWildcards(parsed.hostname);
|
||||
parsed.host = reinstateWildcards(parsed.host);
|
||||
parsed.href = reinstateWildcards(parsed.href);
|
||||
parsed.hostname = _reinstateWildcards(parsed.hostname);
|
||||
parsed.host = _reinstateWildcards(parsed.host);
|
||||
parsed.href = _reinstateWildcards(parsed.href);
|
||||
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
|
||||
const reinstateWildcards = (string) => {
|
||||
function _reinstateWildcards (string) {
|
||||
if (string) {
|
||||
return string.replace(WILDCARD_SUBSTITUTION_PATTERN, WILDCARD_CHARACTER);
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -255,6 +255,10 @@ export function _actuallySend (renderedRequest, workspace, settings) {
|
||||
|
||||
// Set client certs if needed
|
||||
for (const certificate of workspace.certificates) {
|
||||
if (certificate.disabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const cHostWithProtocol = setDefaultProtocol(certificate.host, 'https:');
|
||||
|
||||
if (urlMatchesCertHost(cHostWithProtocol, renderedRequest.url)) {
|
||||
|
||||
Reference in new issue
Block a user