New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendtohttp malformed request, release mega-20191003 #2681
Comments
I am not sure, but it can be because the "=" before the "[" is interpreted as a formula delimiter. |
Related issues:
@giig1967g I think you make a good point here about the '=' messing with the parsing. |
due to brackets after '=' |
As you can see here in my reply on the forum I also had the bracket after the = and it still shows up in the Apache logs just like I expect it to be. |
I just changed the handling of Serial log:
And my rules:
Entry in the Apache log:
|
Hmm, I noticed wrapping the argument with quotes does not strip them. Can you test with this small change in String parseString(const String& string, byte indexFind, bool toEndOfString, bool toLowerCase) {
int startpos = 0;
if (indexFind > 0) {
startpos = getParamStartPos(string, indexFind);
if (startpos < 0) {
return "";
}
}
const int endpos = getParamStartPos(string, indexFind + 1);
String result;
if (toEndOfString || (endpos <= 0)) {
result = string.substring(startpos);
} else {
result = string.substring(startpos, endpos - 1);
}
if (toLowerCase) {
result.toLowerCase();
}
result.trim();
return stripQuotes(result);
} The added part is the See the differences in the Apache logs:
|
…#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.
Thanks for a quick response! Is this commit going to be part of the next automated build? |
As soon as it has been verified :) |
Sorry, I don't understand what you're trying to tell me... I just thought I'll tell you that I run these changes on all my nodes and found no issues with rules etc. So you know that someone (me) is also testing these changes..... |
Oh I really do like the feedback a lot. (really a lot) |
Oh, I love daring things :) An the chances of finding an issue on wider installations is much higher! Besides, of I do find something I also try to explain and of possible provide a fix for what I found so your work and precious time are saved as much as possible!! Also I'd never expect any kind of (quick) support of something fails! I can always go back to older versions if it's critical to me... BTW: I did find one small thing: some of the include paths are wrong (Plugin.h) and therefore won't compile in Arduino without changes... |
In what file? |
5 files where
shoud be
in
|
Great, thanks. Would be nice if PlatformIO could be set more strict in parsing includes like ArduinoIDE does. |
HI, TD-er On System#Boot do //When the ESP boots, do On Rules#Timer=1 do //When Timer1 expires, do Thanks!!! |
Can you also test this build ? (just to be sure it is still working) |
Tested, it works! |
Thanks :) |
If you use variables inside the SentToHTTP command, the request is somehow malformed (server access log shows no query parameters in request) and PHP server doesn't parse the values:
Error: SendToHTTP 192.168.1.1,80,/report.php?val=[Relay#status]
If static values are used, it works. PHP can parse the value of "val":
No error: SendToHTTP 192.168.1.1,80,/report.php?val=1
The text was updated successfully, but these errors were encountered: