Skip to content

Commit

Permalink
Use QueryEscape
Browse files Browse the repository at this point in the history
  • Loading branch information
misery committed May 23, 2021
1 parent 0c9c477 commit 8a802ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ func propagate(bridge *bridgeCfg, name string, value string, prefix string) bool
if stringSuffixInSlice(name, roomFieldsTemperature) {
value = strings.Replace(value, ".", "", -1)
}
value = strings.Replace(value, " ", "+", -1)

url := "http://" + bridge.HeatingURL + "/cgi-bin/writeVal.cgi?" + prefix + "." + name + "=" + value
url := "http://" + bridge.HeatingURL + "/cgi-bin/writeVal.cgi?" + prefix + "." + name + "=" + url.QueryEscape(value)

resp, err := http.Get(url)
if err == nil {
Expand Down

0 comments on commit 8a802ec

Please sign in to comment.