mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-21 17:10:14 +01:00
v0.5.0-rc4: fixing autocert issue, cache ACME registration, added ls-config option
This commit is contained in:
@@ -25,7 +25,7 @@ func NewPathPatterns(s []string) (PathPatterns, E.NestedError) {
|
||||
}
|
||||
pp := make(PathPatterns, len(s))
|
||||
for i, v := range s {
|
||||
if pattern, err := NewPathPattern(v); err.IsNotNil() {
|
||||
if pattern, err := NewPathPattern(v); err.HasError() {
|
||||
return nil, err
|
||||
} else {
|
||||
pp[i] = pattern
|
||||
|
||||
@@ -18,7 +18,7 @@ func NewPort(v string) (Port, E.NestedError) {
|
||||
|
||||
func NewPortInt[Int int | uint16](v Int) (Port, E.NestedError) {
|
||||
pp := Port(v)
|
||||
if err := pp.boundCheck(); err.IsNotNil() {
|
||||
if err := pp.boundCheck(); err.HasError() {
|
||||
return ErrPort, err
|
||||
}
|
||||
return pp, E.Nil()
|
||||
|
||||
@@ -19,21 +19,21 @@ func NewStreamPort(p string) (StreamPort, E.NestedError) {
|
||||
}
|
||||
|
||||
listeningPort, err := NewPort(split[0])
|
||||
if err.IsNotNil() {
|
||||
if err.HasError() {
|
||||
return StreamPort{}, err
|
||||
}
|
||||
if err = listeningPort.boundCheck(); err.IsNotNil() {
|
||||
if err = listeningPort.boundCheck(); err.HasError() {
|
||||
return StreamPort{}, err
|
||||
}
|
||||
|
||||
proxyPort, err := NewPort(split[1])
|
||||
if err.IsNotNil() {
|
||||
if err.HasError() {
|
||||
proxyPort, err = parseNameToPort(split[1])
|
||||
if err.IsNotNil() {
|
||||
if err.HasError() {
|
||||
return StreamPort{}, err
|
||||
}
|
||||
}
|
||||
if err = proxyPort.boundCheck(); err.IsNotNil() {
|
||||
if err = proxyPort.boundCheck(); err.HasError() {
|
||||
return StreamPort{}, err
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ func NewStreamScheme(s string) (ss *StreamScheme, err E.NestedError) {
|
||||
return nil, E.Invalid("stream scheme", s)
|
||||
}
|
||||
ss.ListeningScheme, err = NewScheme(parts[0])
|
||||
if err.IsNotNil() {
|
||||
if err.HasError() {
|
||||
return nil, err
|
||||
}
|
||||
ss.ProxyScheme, err = NewScheme(parts[1])
|
||||
if err.IsNotNil() {
|
||||
if err.HasError() {
|
||||
return nil, err
|
||||
}
|
||||
return ss, E.Nil()
|
||||
|
||||
Reference in New Issue
Block a user