Update to current version of Go library (revision 94d654be2064).

From-SVN: r171076
This commit is contained in:
Ian Lance Taylor 2011-03-16 23:05:44 +00:00
parent f617201f55
commit 5133f00ef8
293 changed files with 16312 additions and 4920 deletions

View file

@ -245,20 +245,20 @@ func handshake(resourceName, host, origin, location, protocol string, br *bufio.
}
// Step 41. check websocket headers.
if resp.Header["Upgrade"] != "WebSocket" ||
strings.ToLower(resp.Header["Connection"]) != "upgrade" {
if resp.Header.Get("Upgrade") != "WebSocket" ||
strings.ToLower(resp.Header.Get("Connection")) != "upgrade" {
return ErrBadUpgrade
}
if resp.Header["Sec-Websocket-Origin"] != origin {
if resp.Header.Get("Sec-Websocket-Origin") != origin {
return ErrBadWebSocketOrigin
}
if resp.Header["Sec-Websocket-Location"] != location {
if resp.Header.Get("Sec-Websocket-Location") != location {
return ErrBadWebSocketLocation
}
if protocol != "" && resp.Header["Sec-Websocket-Protocol"] != protocol {
if protocol != "" && resp.Header.Get("Sec-Websocket-Protocol") != protocol {
return ErrBadWebSocketProtocol
}
@ -304,17 +304,17 @@ func draft75handshake(resourceName, host, origin, location, protocol string, br
if resp.Status != "101 Web Socket Protocol Handshake" {
return ErrBadStatus
}
if resp.Header["Upgrade"] != "WebSocket" ||
resp.Header["Connection"] != "Upgrade" {
if resp.Header.Get("Upgrade") != "WebSocket" ||
resp.Header.Get("Connection") != "Upgrade" {
return ErrBadUpgrade
}
if resp.Header["Websocket-Origin"] != origin {
if resp.Header.Get("Websocket-Origin") != origin {
return ErrBadWebSocketOrigin
}
if resp.Header["Websocket-Location"] != location {
if resp.Header.Get("Websocket-Location") != location {
return ErrBadWebSocketLocation
}
if protocol != "" && resp.Header["Websocket-Protocol"] != protocol {
if protocol != "" && resp.Header.Get("Websocket-Protocol") != protocol {
return ErrBadWebSocketProtocol
}
return