MCPcopy Index your code
hub / github.com/ddev/ddev / CanUseHTTPOnly

Method CanUseHTTPOnly

pkg/ddevapp/utils.go:530–549  ·  view source on GitHub ↗

CanUseHTTPOnly returns true if the project can be accessed via http only

()

Source from the content-addressed store, hash-verified

528
529// CanUseHTTPOnly returns true if the project can be accessed via http only
530func (app *DdevApp) CanUseHTTPOnly() bool {
531 switch {
532 // Codespaces/Devcontainer has its own router with TLS termination
533 case nodeps.IsCodespaces():
534 return false
535 case nodeps.IsDevcontainer():
536 return false
537 // If we have no router, then no https otherwise
538 case IsRouterDisabled(app):
539 return true
540 // If a custom cert, we can do https, so false
541 case app.HasCustomCert():
542 return false
543 // If no mkcert installed, no https
544 case globalconfig.GetCAROOT() == "":
545 return true
546 }
547 // Default case is OK to use https
548 return false
549}
550
551// Turn a slice of *DdevApp into a map keyed by name
552func AppSliceToMap(appList []*DdevApp) map[string]*DdevApp {

Callers 11

GetXHGuiURLMethod · 0.95
GetXHGuiPortMethod · 0.95
GetAllURLsMethod · 0.95
GetPrimaryURLMethod · 0.95
symfonyEnvMailerFunction · 0.80
TestGetAllURLsFunction · 0.80
TestExtraPortExposeFunction · 0.80
runNetworkAliasesTestFunction · 0.80
TestLaunchCommandFunction · 0.80
renderAppDescribeFunction · 0.80

Calls 5

HasCustomCertMethod · 0.95
IsCodespacesFunction · 0.92
IsDevcontainerFunction · 0.92
GetCAROOTFunction · 0.92
IsRouterDisabledFunction · 0.85

Tested by 5

TestGetAllURLsFunction · 0.64
TestExtraPortExposeFunction · 0.64
runNetworkAliasesTestFunction · 0.64
TestLaunchCommandFunction · 0.64