Skip to content

Commit 441be2b

Browse files
committed
go template can work only with sturcts with visible fields
1 parent 891c62c commit 441be2b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/orchestrator/internal/proxy/proxy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ var browserRegex = regexp.MustCompile(`(?i)mozilla|chrome|safari|firefox|edge|op
2626
var browserTemplate = template.Must(template.New("template").Parse(proxyBrowser502PageHtml))
2727

2828
type htmlTemplateData struct {
29-
sandboxId string
30-
sandboxHost string
31-
sandboxPort string
29+
SandboxId string
30+
SandboxHost string
31+
SandboxPort string
3232
}
3333

3434
type jsonTemplateData struct {
@@ -169,7 +169,7 @@ func (p *SandboxProxy) proxyHandler(transport *http.Transport) func(w http.Respo
169169

170170
func (p *SandboxProxy) buildHtmlClosedPortError(sandboxId string, host string, port uint64) ([]byte, error) {
171171
htmlResponse := new(bytes.Buffer)
172-
htmlVars := htmlTemplateData{sandboxId: sandboxId, sandboxHost: host, sandboxPort: strconv.FormatUint(port, 10)}
172+
htmlVars := htmlTemplateData{SandboxId: sandboxId, SandboxHost: host, SandboxPort: strconv.FormatUint(port, 10)}
173173

174174
err := browserTemplate.Execute(htmlResponse, htmlVars)
175175
if err != nil {

packages/orchestrator/internal/proxy/proxy_browser_502.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<img src="https://hebbkx1anhila5yf.public.blob.vercel-storage.com/Symbol%20Gradient-Kr5pnWlK3ZhzBcRGf6Am4cNbJvY1Ge.svg" alt="Logo" class="logo">
1111
<div class="error-header">
1212
<h1 class="error-title">Closed Port Error</h1>
13-
<p class="error-message">The sandbox <span class="highlight" id="sandbox-id">{{.sandboxId}}</span> is running but there&#39s no service running on port <span class="highlight" id="port-number">{{.sandboxPort}}</span>.</p>
13+
<p class="error-message">The sandbox <span class="highlight" id="sandbox-id">{{.SandboxId}}</span> is running but there&#39s no service running on port <span class="highlight" id="port-number">{{.SandboxPort}}</span>.</p>
1414
</div>
1515
<div class="error-details">
16-
<span class="sandbox-url">{{.sandboxHost}}</span>
17-
<div class="error-code">Connection refused on port <span class="highlight" id="port-number-code">{{.sandboxPort}}</span></div>
16+
<span class="sandbox-url">{{.SandboxHost}}</span>
17+
<div class="error-code">Connection refused on port <span class="highlight" id="port-number-code">{{.SandboxPort}}</span></div>
1818
</div>
1919
<p class="help-text">Please ensure that your service is properly configured and running on the specified port.</p>
2020
<a class="debug-link" href="https://e2b.dev/docs/sdk-reference/cli/v1.0.9/sandbox#e2b-sandbox-logs">Check the sandbox logs for more information →</a>

0 commit comments

Comments
 (0)