mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-17 14:09:44 +02:00
refactor: move websocket package and some http utils to seperate repo
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
gphttp "github.com/yusing/godoxy/internal/net/gphttp"
|
||||
nettypes "github.com/yusing/godoxy/internal/net/types"
|
||||
gperr "github.com/yusing/goutils/errs"
|
||||
httputils "github.com/yusing/goutils/http"
|
||||
"github.com/yusing/goutils/http/reverseproxy"
|
||||
strutils "github.com/yusing/goutils/strings"
|
||||
)
|
||||
@@ -118,7 +119,7 @@ var commands = map[string]struct {
|
||||
if err != nil {
|
||||
return nil, ErrInvalidArguments.With(err)
|
||||
}
|
||||
if !gphttp.IsStatusCodeValid(code) {
|
||||
if !httputils.IsStatusCodeValid(code) {
|
||||
return nil, ErrInvalidArguments.Subject(codeStr)
|
||||
}
|
||||
return &Tuple[int, string]{code, text}, nil
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gobwas/glob"
|
||||
gphttp "github.com/yusing/godoxy/internal/net/gphttp"
|
||||
nettypes "github.com/yusing/godoxy/internal/net/types"
|
||||
gperr "github.com/yusing/goutils/errs"
|
||||
httputils "github.com/yusing/goutils/http"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -169,7 +169,7 @@ func validateMethod(args []string) (any, gperr.Error) {
|
||||
return nil, ErrExpectOneArg
|
||||
}
|
||||
method := strings.ToUpper(args[0])
|
||||
if !gphttp.IsMethodValid(method) {
|
||||
if !httputils.IsMethodValid(method) {
|
||||
return nil, ErrInvalidArguments.Subject(method)
|
||||
}
|
||||
return method, nil
|
||||
|
||||
Reference in New Issue
Block a user