Skip to content

Commit

Permalink
Quick change to Autodiscover. When URL is supplied, stop after first …
Browse files Browse the repository at this point in the history
…fail
  • Loading branch information
Etienne Stalmans committed May 11, 2017
1 parent 6f72d3e commit 40f7b56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autodiscover/autodiscover.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er

if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true {
autodiscoverURL = domain
autodiscoverStep = 2
} else {
//create the autodiscover url
if autodiscoverStep == 0 {
Expand Down Expand Up @@ -353,6 +352,9 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
if SessionConfig.Verbose == true {
utils.Error.Printf("Failed, StatusCode [%d]\n", resp.StatusCode)
}
if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true {
return nil, "", fmt.Errorf("Failed to authenticate: StatusCode [%d]\n", resp.StatusCode)
}
if autodiscoverStep < 2 {
autodiscoverStep++
return autodiscover(domain, mapi)
Expand Down

0 comments on commit 40f7b56

Please sign in to comment.