Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hasScheme method fix
  • Loading branch information
rrossetti-splunk committed Jun 26, 2025
commit f321b3b9527b2086090e024b4e4d8b78ba439b80
6 changes: 3 additions & 3 deletions splunk/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package splunk

import (
"net/url"
"strings"
"time"

"github.com/splunk/terraform-provider-splunk/client"
Expand Down Expand Up @@ -153,6 +152,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
}

// hasScheme checks if a string has an "://"
func hasScheme(s string) bool {
return strings.Contains(s, "://") // require URL scheme
func hasScheme(providerUrl string) bool {
parsed, err := url.Parse(providerUrl)
return err == nil && parsed.Scheme != "" && parsed.Host != ""
}
Loading