Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (r *ConnectionRejectedError) Error() string {
return r.reason
}

// StatusCode returns the HTTP status code for the connection rejection.
func (r *ConnectionRejectedError) StatusCode() int {
return r.code
}
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ type Upgrader struct {
// The argument is only valid until the callback returns.
Protocol func([]byte) bool

// ProtocolCustrom allow user to parse Sec-WebSocket-Protocol header manually.
// ProtocolCustom allows users to parse Sec-WebSocket-Protocol header manually.
// Note that returned bytes must be valid until Upgrade returns.
// If ProtocolCustom is set, it used instead of Protocol function.
// If ProtocolCustom is set, it is used instead of Protocol function.
ProtocolCustom func([]byte) (string, bool)

// Extension is a select function that is used to select extensions
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion wsutil/utf8.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var ErrInvalidUTF8 = fmt.Errorf("invalid utf8")
// Another possible case is when some valid sequence become split by the read
// bound. Then UTF8Reader can not make decision about validity of the last
// sequence cause it is not fully read yet. And if the read stops, Valid() will
// return false, even if Read() by itself dit not.
// return false, even if Read() by itself did not.
type UTF8Reader struct {
Source io.Reader

Expand Down