mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
Don't crash on error response to UPnP query (fixes #226)
This commit is contained in:
parent
40c750141a
commit
78f0f2b131
@ -87,6 +87,9 @@ Mx: 3
|
|||||||
reader := bufio.NewReader(bytes.NewBuffer(resp[:n]))
|
reader := bufio.NewReader(bytes.NewBuffer(resp[:n]))
|
||||||
request := &http.Request{}
|
request := &http.Request{}
|
||||||
response, err := http.ReadResponse(reader, request)
|
response, err := http.ReadResponse(reader, request)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if response.Header.Get("St") != "urn:schemas-upnp-org:device:InternetGatewayDevice:1" {
|
if response.Header.Get("St") != "urn:schemas-upnp-org:device:InternetGatewayDevice:1" {
|
||||||
return nil, errors.New("no igd")
|
return nil, errors.New("no igd")
|
||||||
|
Loading…
Reference in New Issue
Block a user