diff --git a/errors.go b/errors.go index f5668b2..da9713e 100644 --- a/errors.go +++ b/errors.go @@ -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 } diff --git a/server.go b/server.go index 863bb22..84c047c 100644 --- a/server.go +++ b/server.go @@ -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 diff --git a/wsutil/extenstion.go b/wsutil/extension.go similarity index 100% rename from wsutil/extenstion.go rename to wsutil/extension.go diff --git a/wsutil/utf8.go b/wsutil/utf8.go index b8dc726..e733141 100644 --- a/wsutil/utf8.go +++ b/wsutil/utf8.go @@ -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