SEZ9 commented on issue #12918:
URL: https://github.com/apache/seatunnel/issues/12918#issuecomment-6306878327
Thanks for the detailed report and reproduction table. The analysis is
consistent with servlet spec behavior: getReader() falls back to ISO-8859-1
when no request encoding is set. A reasonable fix is to make
BaseServlet#requestBody default to UTF-8 when the request has no charset (e.g.
call setCharacterEncoding("UTF-8") before getReader(), or read the InputStream
and decode with UTF-8 explicitly), while still honoring an explicitly declared
charset.
Since you are willing to submit a PR: please cover all v2 endpoints that
read a body (submit-job, submit-jobs, and any others using
BaseServlet#requestBody), and add an e2e/REST test that posts a HOCON body with
non-ASCII job name and Content-Type text/plain without charset, asserting the
job name round-trips as UTF-8.
It may also be worth a short note in the REST API v2 docs that request
bodies are treated as UTF-8 unless a charset is explicitly declared, so client
behavior is predictable.
<!-- streview-comment:1914 -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]