Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedd982e

Browse files
fix(vpn/tunnel): fix panic when starting tunnel with headers (#16565)
`http.Header` is a map so it needs to be initialized ..
1 parentb23e3f9 commitedd982e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎vpn/tunnel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (t *Tunnel) start(req *StartRequest) error {
230230
ifapiToken=="" {
231231
returnxerrors.New("missing api token")
232232
}
233-
varheader http.Header
233+
header:=make(http.Header)
234234
for_,h:=rangereq.GetHeaders() {
235235
header.Add(h.GetName(),h.GetValue())
236236
}

‎vpn/tunnel_internal_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ func TestTunnel_StartStop(t *testing.T) {
100100
TunnelFileDescriptor:2,
101101
CoderUrl:"https://coder.example.com",
102102
ApiToken:"fakeToken",
103+
Headers: []*StartRequest_Header{
104+
{Name:"X-Test-Header",Value:"test"},
105+
},
103106
},
104107
},
105108
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp