ing
This commit is contained in:
parent
8fbf210d2c
commit
530a422ab7
|
@ -32,7 +32,8 @@ type Connectors struct {
|
||||||
|
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
|
|
||||||
RequestHeader http.Header `json:"-"`
|
RequestHeader func() http.Header `json:"-"`
|
||||||
|
|
||||||
Subprotocols []string `json:"subprotocols"`
|
Subprotocols []string `json:"subprotocols"`
|
||||||
// Jar specifies the cookie jar.
|
// Jar specifies the cookie jar.
|
||||||
// If Jar is nil, cookies are not sent in requests and ignored
|
// If Jar is nil, cookies are not sent in requests and ignored
|
||||||
|
@ -220,7 +221,8 @@ func (c *Connectors) dial() (socket.Conn, *http.Response, error) {
|
||||||
if len(subprotocols) > 0 {
|
if len(subprotocols) > 0 {
|
||||||
req.Header["Sec-WebSocket-Protocol"] = []string{strings.Join(subprotocols, ", ")}
|
req.Header["Sec-WebSocket-Protocol"] = []string{strings.Join(subprotocols, ", ")}
|
||||||
}
|
}
|
||||||
for k, vs := range c.RequestHeader {
|
|
||||||
|
for k, vs := range c.RequestHeader() {
|
||||||
switch {
|
switch {
|
||||||
case k == "Host":
|
case k == "Host":
|
||||||
if len(vs) > 0 {
|
if len(vs) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user