Closed t83714 closed 4 years ago
Hi @t83714 thank you for your interest.
faas-cli invoke
does not add newlines, the echo
command in bash adds a new-line, therefore you may prefer to use echo -n
to prevent that newline, or to use some other command or binary as the input i.e. uname | faas-cli invoke
.
If you need further help, please use Slack for technical support issues.
Alex
/msg: slack
-- Join Slack to connect with the community https://docs.openfaas.com/community
Thanks @alexellis 👍
If you invoke your function in the following way:
The input string received by the function (Tested using ofwatch HTTP mode, so here talk about http body) is
123\n
rather than123
.It can't be the issue of the openfaas gateway as if you invoke by sending a POST request directly to gateway:
you won't get the extra newline
\n
Expected Behaviour
No extra newline is appended to the original input
Current Behaviour
An extra newline is appended to the original input if invoke the function using faas-cli only
Possible Solution
N/A
Context
The extra newline
\n
introduced pollute the input and create bugs.You can't simply trim the string input either --- as the invocation through gateway won't introduce an extra newline.
Your Environment
The version I used: