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:
parent
4d44eeb877
commit
765dbb443d
1 changed files with 1 additions and 2 deletions
3
upnp.go
3
upnp.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue