Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connection.onDidChangeConfiguration(change => {
const settings = change.settings as ExtensionSettings
configureHttpRequests(
settings.http && settings.http.proxy,
settings.http && settings.http.proxyStrictSSL
)
const languageSettings: LanguageSettings = {
validate: get(
settings,
input => input.serverlessIDE.validate,
true
),
hover: get(settings, input => input.serverlessIDE.hover, true),
completion: get(
settings,
input => input.serverlessIDE.completion,
true
),
function configureHttpRequest() {
let httpSettings = workspace.getConfiguration('http');
configureXHR(httpSettings.get('proxy'), httpSettings.get('proxyStrictSSL'));
}
public async execute(
command: BaseCommand,
restHttpMethodEnum: RestHttpMethodEnum = RestHttpMethodEnum.Post
): Promise {
if (this.proxyUrl) {
configure(this._proxyUrl, this._proxyStrictSSL);
}
const urlElements = [this.instanceUrl, command.getCommandUrl()];
const requestUrl =
command.getQueryString() == null
? urlElements.join('/')
: urlElements.join('/').concat('?', command.getQueryString()!);
const requestBody = command.getRequest();
const options: XHROptions = {
type: restHttpMethodEnum,
url: requestUrl,
timeout: this.connectionTimeoutMs,
headers: {
'Content-Type': 'application/json;charset=utf-8',
Accept: 'application/json',
Authorization: `OAuth ${this.accessToken}`,
'Content-Length': requestBody
connection.onDidChangeConfiguration(change => {
const settings = change.settings as Settings;
configureHttpRequests(settings.http && settings.http.proxy, settings.http && settings.http.proxyStrictSSL);
specificValidatorPaths = [];
if (settings.yaml) {
yamlConfigurationSettings = settings.yaml.schemas;
yamlShouldValidate = settings.yaml.validate;
yamlShouldHover = settings.yaml.hover;
yamlShouldCompletion = settings.yaml.completion;
customTags = settings.yaml.customTags ? settings.yaml.customTags : [];
if (settings.yaml.schemaStore) {
schemaStoreEnabled = settings.yaml.schemaStore.enable;
}
if (settings.yaml.format) {
yamlFormatterSettings = {
proseWrap: settings.yaml.format.proseWrap || 'preserve',
export function configureHttpRequest() {
let httpSettings = workspace.getConfiguration('http');
httpRequest.configure(httpSettings.get('proxy', ''), httpSettings.get('proxyStrictSSL', false));
}