diff --git a/src/extension.ts b/src/extension.ts index 0927a51..565fabd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -3,6 +3,8 @@ import * as vscode from "vscode"; import * as fs from "fs"; import axios from "axios"; +import * as https from 'https'; +import { RequestOptions } from "../webview/features/requestOptions/requestOptionsSlice"; // this method is called when your extension is activated // your extension is activated the very first time the command is executed @@ -56,7 +58,7 @@ export function activate(context: vscode.ExtensionContext) { ); panel.webview.onDidReceiveMessage( - ({ method, url, headers, body, auth }) => { + ({ method, url, headers, body, auth, options }) => { if (!url) { panel.webview.postMessage({ type: "response", @@ -116,6 +118,12 @@ export function activate(context: vscode.ExtensionContext) { headersObj["Content-Type"] = "application/json"; } + // Options Section + let requestOptions = options as RequestOptions; + + // Option 1. StrictSSL + https.globalAgent.options.rejectUnauthorized = (requestOptions.strictSSL === "yes"); + axios({ method, url, diff --git a/webview/components/RequestBar/index.tsx b/webview/components/RequestBar/index.tsx index c944d52..4421260 100644 --- a/webview/components/RequestBar/index.tsx +++ b/webview/components/RequestBar/index.tsx @@ -8,6 +8,7 @@ import { selectRequestBody } from "../../features/requestBody/requestBodySlice"; import { selectRequestHeaders } from "../../features/requestHeader/requestHeaderSlice"; import { selectRequestUrl } from "../../features/requestUrl/requestUrlSlice"; import { selectRequestMethod } from "../../features/requestMethod/requestMethodSlice"; +import { selectRequestOptions } from "../../features/requestOptions/requestOptionsSlice"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import "./styles.css"; @@ -19,6 +20,7 @@ export const RequestBar = () => { const requestBody = useAppSelector(selectRequestBody); const requestUrl = useAppSelector(selectRequestUrl); const requestAuth = useAppSelector(selectRequestAuth); + const requestOptions = useAppSelector(selectRequestOptions); return (