mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
fix prefix check when returning early (#2503)
This commit is contained in:
parent
8a825fde52
commit
2d2ca4d3d6
1 changed files with 3 additions and 3 deletions
|
@ -53,12 +53,12 @@ func isMySQLErrorDeterminate(err error) bool {
|
|||
func parseConnStr(connStr string) (hostAndDB, params string, err error) {
|
||||
// expected form: [subprotocol:]//[user:password@]HOST[/DB][?key=val[&key=val]]
|
||||
hostAndDB, params, found := strings.Cut(connStr, "?")
|
||||
if !found {
|
||||
return hostAndDB, "", nil
|
||||
}
|
||||
if !strings.HasPrefix(hostAndDB, "//") {
|
||||
return "", "", errors.New("expected host to start with //")
|
||||
}
|
||||
if !found {
|
||||
return hostAndDB, "", nil
|
||||
}
|
||||
splitParams := strings.Split(params, "&")
|
||||
for i, param := range splitParams {
|
||||
if strings.Contains(strings.ToLower(param), "allowallfiles") {
|
||||
|
|
Loading…
Reference in a new issue