mirror of https://github.com/arendst/Tasmota.git
Fix command WebSend
Fix command WebSend when using a port number as regression from 6.4.1.17 (#5304)
This commit is contained in:
parent
d219d1c9b5
commit
e315be0619
|
@ -3,6 +3,7 @@
|
|||
* Fix some exceptions and watchdogs due to lack of stack space - part 2
|
||||
* Add command SetOption62 0/1 to disable retain on Button or Swith hold messages (#5299)
|
||||
* Add option WifiConfig 7 to allow reset of device in AP mode without admin password (#5297)
|
||||
* Fix command WebSend when using a port number as regression from 6.4.1.17 (#5304)
|
||||
*
|
||||
* 6.4.1.17 20190214
|
||||
* Change template update by removing possibility to add user module config keeping template as defined (#5222)
|
||||
|
|
|
@ -2182,18 +2182,19 @@ int WebSend(char *buffer)
|
|||
// buffer = | [ 192.168.178.86 : 80 , admin : joker ] POWER1 ON |
|
||||
host = strtok_r(buffer, "]", &command); // host = | [ 192.168.178.86 : 80 , admin : joker |, command = | POWER1 ON |
|
||||
if (host && command) {
|
||||
String url = F("http:"); // url = |http:|
|
||||
String url = F("http://"); // url = |http://|
|
||||
host = Trim(host); // host = |[ 192.168.178.86 : 80 , admin : joker|
|
||||
host++; // host = | 192.168.178.86 : 80 , admin : joker| - Skip [
|
||||
host = strtok_r(host, ",", &user); // host = | 192.168.178.86 : 80 |, user = | admin : joker|
|
||||
host = strtok_r(host, ":", &port); // host = | 192.168.178.86 |, port = | 80 |
|
||||
host = Trim(host); // host = |192.168.178.86|
|
||||
url += host; // url = |http://192.168.178.86|
|
||||
|
||||
if (port) {
|
||||
port = Trim(port); // port = |80|
|
||||
url += port; // url = |http:80|
|
||||
url += F(":"); // url = |http://192.168.178.86:|
|
||||
url += port; // url = |http://192.168.178.86:80|
|
||||
}
|
||||
url += F("//"); // url = |http://| or |http:80//|
|
||||
url += host; // url = |http://192.168.178.86|
|
||||
|
||||
if (user) {
|
||||
user = strtok_r(user, ":", &password); // user = | admin |, password = | joker|
|
||||
|
|
Loading…
Reference in New Issue