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
check_nscp_api: support spaces in query arguments #5537
Comments
@Crunsher ACQUERY_ENCODE does not include whitespaces when called with Utility::EscapeString(). This could be a possible reason. |
This issue occurs for all arguments not just "--query", e.g.:
This occurs because a lexical_cast from a std::string containing spaces to icinga::String throws a boost::bad_lexical_cast exception. I believe is due to the fact that lexical_cast uses the >> operator which splits on whitespace. See my PR for a fix. |
I can confirm that @atj fixed the problem in his PR. |
Confirmed, breaks here as well.
Seems that Windows accepts the workaround without spaces too. |
Better test case is in #5539. |
Trying to use
check_nscp_api
to check a Windows service with a space in it's name, we get the error messagethe argument ('service=Haufe FabricHostService') for option '--arguments' is invalid
. No amount of escaping the space will fix this, and actually substituting the space wit%20
seems to lead to double-escaping the string.However, using
curl
, we can see this works:Version is 1.0.0:
The text was updated successfully, but these errors were encountered: