Logs module unable to return non-ASCII characters
1) Start a proxy (upstream develop branch is affected as well):
2) Have "logs" module enabled
3) Send arbitrary binary data via TCP plain connection to HTTP endpoint: nc localhost 8448 < /usr/bin/bash
4) Call logs API: curl-proxy /logs
D, [2018-07-24T09:58:14.814774 ] DEBUG -- : "\xB0" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
/home/lzap/work/smart-proxy/modules/logs/logs_api.rb:15:in `block in <class:LogsApi>'
#8 Updated by Lukas Zapletal almost 2 years ago
For Katello there are some steps required in order to reproduce:
1) Make sure that HTTP endpoint is enabled (to do that install templates plugin):
2) Send some UTF-8 decoder unfriendly data TO PORT 8000 (not 9090 that's HTTPS and the stack will refuse to pass this into the app)
nc localhost 8000 < /usr/bin/bash
3) Then access logs remotely:
- curl -s --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem --cacert /etc/foreman/proxy_ca.pem https://$(hostname):9090/logs
"\xE1" from ASCII-8BIT to UTF-8
Formatting is slightly different but apparently the bug is there. When you turn on DEBUG the message will be pretty clear.