MCPcopy Create free account
hub / github.com/Scalingo/cli / ForceHTTPS

Function ForceHTTPS

apps/routing_settings.go:11–31  ·  view source on GitHub ↗
(ctx context.Context, appName string, enable bool)

Source from the content-addressed store, hash-verified

9)
10
11func ForceHTTPS(ctx context.Context, appName string, enable bool) error {
12 c, err := config.ScalingoClient(ctx)
13 if err != nil {
14 return errors.Wrapf(ctx, err, "fail to get Scalingo client")
15 }
16
17 _, err = c.AppsForceHTTPS(ctx, appName, enable)
18 if err != nil {
19 return errors.Wrapf(ctx, err, "fail to configure force-https feature")
20 }
21
22 var action string
23 if enable {
24 action = "enable"
25 } else {
26 action = "disable"
27 }
28
29 io.Statusf("Force HTTPS has been %sd on %s\n", action, appName)
30 return nil
31}
32
33func StickySession(ctx context.Context, appName string, enable bool) error {
34 c, err := config.ScalingoClient(ctx)

Callers 1

Calls 2

ScalingoClientFunction · 0.92
StatusfFunction · 0.92

Tested by

no test coverage detected