Fix a bug in fetching the XML URL.

In Discover, the reponse was lowercased for comparison.  However,
this caused a 404 - Not found when fetching the url provided by
the location header if the url contained uppercase.

ok @owainga
This commit is contained in:
David Hill 2014-04-23 18:08:57 -04:00
parent 4d44eeb877
commit 765dbb443d

View file

@ -110,8 +110,7 @@ func Discover() (nat NAT, err error) {
// HTTP header field names are case-insensitive.
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
locString := "\r\nlocation: "
answer = strings.ToLower(answer)
locIndex := strings.Index(answer, locString)
locIndex := strings.Index(strings.ToLower(answer), locString)
if locIndex < 0 {
continue
}