mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-31 06:03:06 +02:00
refactor: rename net/types to nettypes
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/yusing/go-proxy/internal/gperr"
|
||||
gphttp "github.com/yusing/go-proxy/internal/net/gphttp"
|
||||
"github.com/yusing/go-proxy/internal/net/gphttp/reverseproxy"
|
||||
"github.com/yusing/go-proxy/internal/net/types"
|
||||
nettypes "github.com/yusing/go-proxy/internal/net/types"
|
||||
"github.com/yusing/go-proxy/internal/utils/strutils"
|
||||
)
|
||||
|
||||
@@ -95,7 +95,7 @@ var commands = map[string]struct {
|
||||
},
|
||||
validate: validateURL,
|
||||
build: func(args any) CommandHandler {
|
||||
target := args.(*types.URL).String()
|
||||
target := args.(*nettypes.URL).String()
|
||||
return ReturningCommand(func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, target, http.StatusTemporaryRedirect)
|
||||
})
|
||||
@@ -160,7 +160,7 @@ var commands = map[string]struct {
|
||||
},
|
||||
validate: validateAbsoluteURL,
|
||||
build: func(args any) CommandHandler {
|
||||
target := args.(*types.URL)
|
||||
target := args.(*nettypes.URL)
|
||||
if target.Scheme == "" {
|
||||
target.Scheme = "http"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user