TUN-8685: Bump coredns dependency
Some checks are pending
Check / check (1.22.x, macos-latest) (push) Waiting to run
Check / check (1.22.x, ubuntu-latest) (push) Waiting to run
Check / check (1.22.x, windows-latest) (push) Waiting to run
Semgrep config / semgrep/ci (push) Waiting to run

Closes TUN-8685
This commit is contained in:
Devin Carr
2024-10-17 13:09:39 -07:00
parent abb3466c31
commit d608a64cc5
127 changed files with 4201 additions and 1747 deletions

View File

@@ -2,12 +2,12 @@ package ws
// RejectOption represents an option used to control the way connection is
// rejected.
type RejectOption func(*rejectConnectionError)
type RejectOption func(*ConnectionRejectedError)
// RejectionReason returns an option that makes connection to be rejected with
// given reason.
func RejectionReason(reason string) RejectOption {
return func(err *rejectConnectionError) {
return func(err *ConnectionRejectedError) {
err.reason = reason
}
}
@@ -15,7 +15,7 @@ func RejectionReason(reason string) RejectOption {
// RejectionStatus returns an option that makes connection to be rejected with
// given HTTP status code.
func RejectionStatus(code int) RejectOption {
return func(err *rejectConnectionError) {
return func(err *ConnectionRejectedError) {
err.code = code
}
}
@@ -23,32 +23,37 @@ func RejectionStatus(code int) RejectOption {
// RejectionHeader returns an option that makes connection to be rejected with
// given HTTP headers.
func RejectionHeader(h HandshakeHeader) RejectOption {
return func(err *rejectConnectionError) {
return func(err *ConnectionRejectedError) {
err.header = h
}
}
// RejectConnectionError constructs an error that could be used to control the way
// handshake is rejected by Upgrader.
// RejectConnectionError constructs an error that could be used to control the
// way handshake is rejected by Upgrader.
func RejectConnectionError(options ...RejectOption) error {
err := new(rejectConnectionError)
err := new(ConnectionRejectedError)
for _, opt := range options {
opt(err)
}
return err
}
// rejectConnectionError represents a rejection of upgrade error.
// ConnectionRejectedError represents a rejection of connection during
// WebSocket handshake error.
//
// It can be returned by Upgrader's On* hooks to control the way WebSocket
// handshake is rejected.
type rejectConnectionError struct {
// It can be returned by Upgrader's On* hooks to indicate that WebSocket
// handshake should be rejected.
type ConnectionRejectedError struct {
reason string
code int
header HandshakeHeader
}
// Error implements error interface.
func (r *rejectConnectionError) Error() string {
func (r *ConnectionRejectedError) Error() string {
return r.reason
}
func (r *ConnectionRejectedError) StatusCode() int {
return r.code
}