feat: wire gui instance start and delete confirmation
This commit is contained in:
@@ -50,15 +50,18 @@ func (s LaunchSpec) Normalize() (LaunchSpec, error) {
|
||||
return LaunchSpec{}, fmt.Errorf("%w: user data dir must be absolute", ErrInvalidLaunchSpec)
|
||||
}
|
||||
target := strings.TrimSpace(s.TargetURL)
|
||||
parsed, err := url.Parse(target)
|
||||
if err != nil || parsed.Host == "" || parsed.User != nil || (parsed.Scheme != "http" && parsed.Scheme != "https") {
|
||||
return LaunchSpec{}, fmt.Errorf("%w: target URL must be absolute http or https", ErrInvalidLaunchSpec)
|
||||
if target != "" {
|
||||
parsed, err := url.Parse(target)
|
||||
if err != nil || parsed.Host == "" || parsed.User != nil || (parsed.Scheme != "http" && parsed.Scheme != "https") {
|
||||
return LaunchSpec{}, fmt.Errorf("%w: target URL must be absolute http or https", ErrInvalidLaunchSpec)
|
||||
}
|
||||
target = parsed.String()
|
||||
}
|
||||
normalized := s
|
||||
normalized.Executable = strings.TrimSpace(s.Executable)
|
||||
normalized.UserDataDir = filepath.Clean(userDataDir)
|
||||
normalized.ProfileDirectory = strings.TrimSpace(s.ProfileDirectory)
|
||||
normalized.TargetURL = parsed.String()
|
||||
normalized.TargetURL = target
|
||||
normalized.ProxyServer = strings.TrimSpace(s.ProxyServer)
|
||||
normalized.ExtraArgs = append([]string(nil), s.ExtraArgs...)
|
||||
return normalized, nil
|
||||
|
||||
Reference in New Issue
Block a user