MCPcopy Index your code
hub / github.com/gobwas/ws / httpWriteResponseUpgrade

Function httpWriteResponseUpgrade

http.go:334–354  ·  view source on GitHub ↗
(bw *bufio.Writer, nonce []byte, hs Handshake, header HandshakeHeaderFunc)

Source from the content-addressed store, hash-verified

332}
333
334func httpWriteResponseUpgrade(bw *bufio.Writer, nonce []byte, hs Handshake, header HandshakeHeaderFunc) {
335 bw.WriteString(textHeadUpgrade)
336
337 httpWriteHeaderKey(bw, headerSecAccept)
338 writeAccept(bw, nonce)
339 bw.WriteString(crlf)
340
341 if hs.Protocol != "" {
342 httpWriteHeader(bw, headerSecProtocol, hs.Protocol)
343 }
344 if len(hs.Extensions) > 0 {
345 httpWriteHeaderKey(bw, headerSecExtensions)
346 httphead.WriteOptions(bw, hs.Extensions)
347 bw.WriteString(crlf)
348 }
349 if header != nil {
350 header(bw)
351 }
352
353 bw.WriteString(crlf)
354}
355
356func httpWriteResponseError(bw *bufio.Writer, err error, code int, header HandshakeHeaderFunc) {
357 switch code {

Callers 2

UpgradeMethod · 0.85
UpgradeMethod · 0.85

Calls 4

httpWriteHeaderKeyFunction · 0.85
writeAcceptFunction · 0.85
httpWriteHeaderFunction · 0.85
WriteStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…