From 2aa028facb7ccbe48e85c8c444501cc3fb38ef24 Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Sat, 31 Oct 2015 15:36:08 +0000 Subject: [PATCH] Add user-agent header, capitalize headers as others seems to do it (fixes #2422) --- lib/upnp/upnp.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/upnp/upnp.go b/lib/upnp/upnp.go index f8e4cf9e..6031d146 100644 --- a/lib/upnp/upnp.go +++ b/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)