mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	Make sure Root is set for all new SiteConfigs
This situation typically only arises in tests...
This commit is contained in:
		
							parent
							
								
									ff22fbd79a
								
							
						
					
					
						commit
						71c14fa16e
					
				@ -155,8 +155,7 @@ func GetConfig(addrKey string) *SiteConfig {
 | 
				
			|||||||
		// this shouldn't happen except in tests
 | 
							// this shouldn't happen except in tests
 | 
				
			||||||
		newContext()
 | 
							newContext()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	cfg := new(SiteConfig)
 | 
						cfg := &SiteConfig{Root: Root, TLS: new(caddytls.Config)}
 | 
				
			||||||
	cfg.TLS = new(caddytls.Config)
 | 
					 | 
				
			||||||
	defaultCtx := contexts[len(contexts)-1]
 | 
						defaultCtx := contexts[len(contexts)-1]
 | 
				
			||||||
	defaultCtx.siteConfigs = append(defaultCtx.siteConfigs, cfg)
 | 
						defaultCtx.siteConfigs = append(defaultCtx.siteConfigs, cfg)
 | 
				
			||||||
	defaultCtx.keysToSiteConfigs[addrKey] = cfg
 | 
						defaultCtx.keysToSiteConfigs[addrKey] = cfg
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user