From 4e0218f5eacf839fce9f33e451fd66a3207ab9ca Mon Sep 17 00:00:00 2001 From: Di_Moon Date: Fri, 14 Aug 2020 11:54:30 +0300 Subject: [PATCH 1/2] add proxy support when communicate with plantuml --- domain/section/plantuml/plantuml.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/domain/section/plantuml/plantuml.go b/domain/section/plantuml/plantuml.go index fb7802c7..856d5d5e 100644 --- a/domain/section/plantuml/plantuml.go +++ b/domain/section/plantuml/plantuml.go @@ -102,9 +102,12 @@ func (p *Provider) generateDiagram(ctx *provider.Context, data string) string { org, _ := p.Store.Organization.GetOrganization(ctx.Request, ctx.OrgID) var transport = &http.Transport{ + Proxy: http.ProxyFromEnvironment, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, // TODO should be glick.InsecureSkipVerifyTLS (from -insecure flag) but get error: x509: certificate signed by unknown authority + }} + client := &http.Client{Transport: transport} resp, _ := client.Post(org.ConversionEndpoint+"/api/plantuml", "application/text; charset=utf-8", bytes.NewReader([]byte(data))) From c7413da9437624175c26ea06b1622c595e3cf32f Mon Sep 17 00:00:00 2001 From: Di_Moon Date: Fri, 14 Aug 2020 11:56:27 +0300 Subject: [PATCH 2/2] add proxy support when communicate with plantuml (remove spaces) --- domain/section/plantuml/plantuml.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/domain/section/plantuml/plantuml.go b/domain/section/plantuml/plantuml.go index 856d5d5e..c4e48ed2 100644 --- a/domain/section/plantuml/plantuml.go +++ b/domain/section/plantuml/plantuml.go @@ -105,9 +105,7 @@ func (p *Provider) generateDiagram(ctx *provider.Context, data string) string { Proxy: http.ProxyFromEnvironment, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, // TODO should be glick.InsecureSkipVerifyTLS (from -insecure flag) but get error: x509: certificate signed by unknown authority - }} - client := &http.Client{Transport: transport} resp, _ := client.Post(org.ConversionEndpoint+"/api/plantuml", "application/text; charset=utf-8", bytes.NewReader([]byte(data)))