Skip to content

Commit e315be0

Browse files
committed
Fix command WebSend
Fix command WebSend when using a port number as regression from 6.4.1.17 (#5304)
1 parent d219d1c commit e315be0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sonoff/_changelog.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Fix some exceptions and watchdogs due to lack of stack space - part 2
44
* Add command SetOption62 0/1 to disable retain on Button or Swith hold messages (#5299)
55
* Add option WifiConfig 7 to allow reset of device in AP mode without admin password (#5297)
6+
* Fix command WebSend when using a port number as regression from 6.4.1.17 (#5304)
67
*
78
* 6.4.1.17 20190214
89
* Change template update by removing possibility to add user module config keeping template as defined (#5222)

sonoff/xdrv_01_webserver.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,18 +2182,19 @@ int WebSend(char *buffer)
21822182
// buffer = | [ 192.168.178.86 : 80 , admin : joker ] POWER1 ON |
21832183
host = strtok_r(buffer, "]", &command); // host = | [ 192.168.178.86 : 80 , admin : joker |, command = | POWER1 ON |
21842184
if (host && command) {
2185-
String url = F("http:"); // url = |http:|
2185+
String url = F("http://"); // url = |http://|
21862186
host = Trim(host); // host = |[ 192.168.178.86 : 80 , admin : joker|
21872187
host++; // host = | 192.168.178.86 : 80 , admin : joker| - Skip [
21882188
host = strtok_r(host, ",", &user); // host = | 192.168.178.86 : 80 |, user = | admin : joker|
21892189
host = strtok_r(host, ":", &port); // host = | 192.168.178.86 |, port = | 80 |
21902190
host = Trim(host); // host = |192.168.178.86|
2191+
url += host; // url = |http://192.168.178.86|
2192+
21912193
if (port) {
21922194
port = Trim(port); // port = |80|
2193-
url += port; // url = |http:80|
2195+
url += F(":"); // url = |http://192.168.178.86:|
2196+
url += port; // url = |http://192.168.178.86:80|
21942197
}
2195-
url += F("//"); // url = |http://| or |http:80//|
2196-
url += host; // url = |http://192.168.178.86|
21972198

21982199
if (user) {
21992200
user = strtok_r(user, ":", &password); // user = | admin |, password = | joker|

0 commit comments

Comments
 (0)