Skip to content
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

Support for UTF-8 POST/PUT/PATCH REST requests #733

Open
donaldoakes opened this issue Aug 27, 2019 · 0 comments
Open

Support for UTF-8 POST/PUT/PATCH REST requests #733

donaldoakes opened this issue Aug 27, 2019 · 0 comments
Milestone

Comments

@donaldoakes
Copy link
Collaborator

The default character set per Java servlet spec is ISO-8859-1. MalformedInputExceptions can occur when non ISO-8859-1 characters are encountered in the request body (see below).

We should provide a way to configure the servlet to expect UTF-8 (and maybe this should be the default).

java.nio.charset.MalformedInputException: Input length = 1
                at java.nio.charset.CoderResult.throwException(CoderResult.java:281) ~[na:1.8.0_212]
                at org.apache.tomcat.util.buf.B2CConverter.convert(B2CConverter.java:275) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at org.apache.catalina.connector.InputBuffer.realReadChars(InputBuffer.java:426) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at org.apache.catalina.connector.InputBuffer.checkCharBufferEof(InputBuffer.java:652) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:468) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at org.apache.catalina.connector.CoyoteReader.read(CoyoteReader.java:108) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at org.apache.catalina.connector.CoyoteReader.readLine(CoyoteReader.java:163) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at com.centurylink.mdw.hub.servlet.RestServlet.handleRequest(RestServlet.java:242) ~[mdw-spring-boot-6.1.22.jar!/:na]
                at com.centurylink.mdw.hub.servlet.RestServlet.doPost(RestServlet.java:144) ~[mdw-spring-boot-6.1.22.jar!/:na]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
                at com.centurylink.mdw.hub.servlet.RestServlet.service(RestServlet.java:224) ~[mdw-spring-boot-6.1.22.jar!/:na]
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.32.jar!/:8.5.32]
@donaldoakes donaldoakes added this to the 6.x milestone Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant