Explorar o código

Add user-agent header, capitalize headers as others seems to do it (fixes #2422)

Audrius Butkevicius %!s(int64=10) %!d(string=hai) anos
pai
achega
2aa028facb
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      lib/upnp/upnp.go

+ 5 - 4
lib/upnp/upnp.go

@@ -158,10 +158,11 @@ func discover(intf *net.Interface, deviceType string, timeout time.Duration, res
 	ssdp := &net.UDPAddr{IP: []byte{239, 255, 255, 250}, Port: 1900}
 
 	tpl := `M-SEARCH * HTTP/1.1
-Host: 239.255.255.250:1900
-St: %s
-Man: "ssdp:discover"
-Mx: %d
+HOST: 239.255.255.250:1900
+ST: %s
+MAN: "ssdp:discover"
+MX: %d
+USER-AGENT: syncthing/1.0
 
 `
 	searchStr := fmt.Sprintf(tpl, deviceType, timeout/time.Second)