Skip to content

Commit 40f7b56

Browse files
author
Etienne Stalmans
committed
Quick change to Autodiscover. When URL is supplied, stop after first fail
1 parent 6f72d3e commit 40f7b56

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

autodiscover/autodiscover.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
239239

240240
if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true {
241241
autodiscoverURL = domain
242-
autodiscoverStep = 2
243242
} else {
244243
//create the autodiscover url
245244
if autodiscoverStep == 0 {
@@ -353,6 +352,9 @@ func autodiscover(domain string, mapi bool) (*utils.AutodiscoverResp, string, er
353352
if SessionConfig.Verbose == true {
354353
utils.Error.Printf("Failed, StatusCode [%d]\n", resp.StatusCode)
355354
}
355+
if m, _ := regexp.Match("http[s]?://", []byte(domain)); m == true {
356+
return nil, "", fmt.Errorf("Failed to authenticate: StatusCode [%d]\n", resp.StatusCode)
357+
}
356358
if autodiscoverStep < 2 {
357359
autodiscoverStep++
358360
return autodiscover(domain, mapi)

0 commit comments

Comments
 (0)