make fmt
This commit is contained in:
@@ -118,11 +118,11 @@ func TestAPI_ErrorPaths(t *testing.T) {
|
|||||||
assertStatus(t, apiPost(t, env.BaseURL+"/api/redirection-hosts/bad/enable", nil, token), http.StatusBadRequest)
|
assertStatus(t, apiPost(t, env.BaseURL+"/api/redirection-hosts/bad/enable", nil, token), http.StatusBadRequest)
|
||||||
|
|
||||||
first := apiPost(t, env.BaseURL+"/api/redirection-hosts", map[string]any{
|
first := apiPost(t, env.BaseURL+"/api/redirection-hosts", map[string]any{
|
||||||
"domainNames": []string{"dup-redir.example"},
|
"domainNames": []string{"dup-redir.example"},
|
||||||
"forwardDomainName": "target.example",
|
"forwardDomainName": "target.example",
|
||||||
"forwardScheme": "https",
|
"forwardScheme": "https",
|
||||||
"preservePath": true,
|
"preservePath": true,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
}, token)
|
}, token)
|
||||||
if first.StatusCode != http.StatusCreated {
|
if first.StatusCode != http.StatusCreated {
|
||||||
t.Fatalf("redir create: %d %s", first.StatusCode, readBody(first))
|
t.Fatalf("redir create: %d %s", first.StatusCode, readBody(first))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
type testServerMode int
|
type testServerMode int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
testServerAPI testServerMode = iota
|
testServerAPI testServerMode = iota
|
||||||
testServerAdmin
|
testServerAdmin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ func NewEngine(st store.Store) *Engine {
|
|||||||
return &Engine{
|
return &Engine{
|
||||||
hosts: make(map[string]*Host),
|
hosts: make(map[string]*Host),
|
||||||
st: st,
|
st: st,
|
||||||
streamHandles: make(map[int]*streamHandle),
|
streamHandles: make(map[int]*streamHandle),
|
||||||
streamRuntime: make(map[int]*streamRuntime),
|
streamRuntime: make(map[int]*streamRuntime),
|
||||||
hostCerts: make(map[string]*tls.Certificate),
|
hostCerts: make(map[string]*tls.Certificate),
|
||||||
certByID: make(map[int]*tls.Certificate),
|
certByID: make(map[int]*tls.Certificate),
|
||||||
redirHosts: make(map[string]store.RedirectionHost),
|
redirHosts: make(map[string]store.RedirectionHost),
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrDuplicateProxySource = errors.New("duplicate proxy host source domain")
|
ErrDuplicateProxySource = errors.New("duplicate proxy host source domain")
|
||||||
ErrDuplicateRedirectionSource = errors.New("duplicate redirection host source domain")
|
ErrDuplicateRedirectionSource = errors.New("duplicate redirection host source domain")
|
||||||
ErrDuplicateDeadSource = errors.New("duplicate dead host source domain")
|
ErrDuplicateDeadSource = errors.New("duplicate dead host source domain")
|
||||||
ErrDuplicateStreamPort = errors.New("duplicate stream incoming port")
|
ErrDuplicateStreamPort = errors.New("duplicate stream incoming port")
|
||||||
)
|
)
|
||||||
|
|
||||||
func IsConflictError(err error) bool {
|
func IsConflictError(err error) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user