(ctx context.Context, appName string, enable bool)
| 9 | ) |
| 10 | |
| 11 | func 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 | |
| 33 | func StickySession(ctx context.Context, appName string, enable bool) error { |
| 34 | c, err := config.ScalingoClient(ctx) |
no test coverage detected