mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 05:08:28 +02:00
Fixed #435
This commit is contained in:
@@ -70,9 +70,10 @@ func (router *Router) PrepareProxyRoute(endpoint *ProxyEndpoint) (*ProxyEndpoint
|
||||
|
||||
// Add Proxy Route to current runtime. Call to PrepareProxyRoute before adding to runtime
|
||||
func (router *Router) AddProxyRouteToRuntime(endpoint *ProxyEndpoint) error {
|
||||
lookupHostname := strings.ToLower(endpoint.RootOrMatchingDomain)
|
||||
if len(endpoint.ActiveOrigins) == 0 {
|
||||
//There are no active origins. No need to check for ready
|
||||
router.ProxyEndpoints.Store(endpoint.RootOrMatchingDomain, endpoint)
|
||||
router.ProxyEndpoints.Store(lookupHostname, endpoint)
|
||||
return nil
|
||||
}
|
||||
if !router.loadBalancer.UpstreamsReady(endpoint.ActiveOrigins) {
|
||||
@@ -80,7 +81,7 @@ func (router *Router) AddProxyRouteToRuntime(endpoint *ProxyEndpoint) error {
|
||||
return errors.New("proxy endpoint not ready. Use PrepareProxyRoute before adding to runtime")
|
||||
}
|
||||
// Push record into running subdomain endpoints
|
||||
router.ProxyEndpoints.Store(endpoint.RootOrMatchingDomain, endpoint)
|
||||
router.ProxyEndpoints.Store(lookupHostname, endpoint)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user