Skip to content

Commit

Permalink
[sendToHttp] Trim spaces from path (letscontrolit#2681, letscontrolit…
Browse files Browse the repository at this point in the history
…#2660)

The changed rules parsing may have added some spaces in replaced variables.
Adding a trim() call to the parseString does remove any existing or added spaces in the parameter.
  • Loading branch information
TD-er committed Oct 24, 2019
1 parent f8168e9 commit 8792e58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ESPEasy_fdwdecl.h
Expand Up @@ -141,4 +141,6 @@ void serialPrint(const String& text);
void setLogLevelFor(byte destination, byte logLevel);
uint16_t getPortFromKey(uint32_t key);

String parseStringToEndKeepCase(const String& string, byte indexFind);

#endif // ESPEASY_FWD_DECL_H
1 change: 1 addition & 0 deletions src/StringConverter.ino
Expand Up @@ -405,6 +405,7 @@ String parseString(const String& string, byte indexFind, bool toEndOfString, boo
if (toLowerCase) {
result.toLowerCase();
}
result.trim();
return stripQuotes(result);
}

Expand Down
2 changes: 1 addition & 1 deletion src/src/Commands/Diagnostic.cpp
Expand Up @@ -133,7 +133,7 @@ String Command_Debug(struct EventStruct *event, const char* Line)

String Command_logentry(struct EventStruct *event, const char* Line)
{
addLog(LOG_LEVEL_INFO,Line);
addLog(LOG_LEVEL_INFO, parseStringToEndKeepCase(Line, 2));
return return_command_success();
}

Expand Down

0 comments on commit 8792e58

Please sign in to comment.