[GitlabService] Respect vscode http.proxy setting

See merge request fatihacet/gitlab-vscode-extension!13
......@@ -6,4 +6,5 @@
- Christian Svensson [@csvn](https://gitlab.com/csvn)
- Alpcan Aydin [@alpcanaydin](https://gitlab.com/alpcanaydin)
- Pierre [@piec](https://gitlab.com/piec)
- Adem Ilter[@ademilter](https://twitter.com/ademilter)
- Adem Ilter [@ademilter](https://twitter.com/ademilter)
- Abbas Mashayekh [@martianboy][https://gitlab.com/martianboy]
\ No newline at end of file
......@@ -10,6 +10,7 @@ let branchMR = null;
async function fetch(path, method = 'GET', data = null) {
const { instanceUrl, ignoreCertificateErrors, ca } = vscode.workspace.getConfiguration('gitlab');
const { proxy } = vscode.workspace.getConfiguration('http');
const apiRoot = `${instanceUrl}/api/v4`;
const glToken = tokenService.getToken(instanceUrl);
......@@ -28,6 +29,10 @@ async function fetch(path, method = 'GET', data = null) {
rejectUnauthorized: !ignoreCertificateErrors,
};
if (proxy) {
config.proxy = proxy;
}
if (ca) {
try {
config.ca = fs.readFileSync(ca);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册