diff options
| author | Shulhan <ms@kilabit.info> | 2023-05-16 12:48:55 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-05-16 12:48:55 +0700 |
| commit | 0820f2234c014bb205e1e7cb405e0ad014b7ff12 (patch) | |
| tree | 27166800bc1865bd09c050d12953dd80154528d5 /errors.go | |
| parent | c484bc6ec480dd799c491b3dd0f673f822c3b484 (diff) | |
| download | gorankusu-0820f2234c014bb205e1e7cb405e0ad014b7ff12.tar.xz | |
all: fix panic when attacking HTTP due to nil Attack handler
In attack endpoint, check if the Attack is nil before we push the request
to attack queue.
Diffstat (limited to 'errors.go')
| -rw-r--r-- | errors.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -35,6 +35,14 @@ func errAttackNotAllowed() error { return res } +var errAttackHandlerNotSet = libhttp.EndpointResponse{ + E: liberrors.E{ + Code: http.StatusNotAcceptable, + Message: `the Attack handler is not set`, + Name: `ERR_ATTACK_HANDLER_NOT_SET`, + }, +} + func errInternal(err error) error { res := &libhttp.EndpointResponse{ E: liberrors.E{ |
