Skip to content

Commit

Permalink
As per servlet spec 3.1, when Request.setCharacterEncoding(String enc…
Browse files Browse the repository at this point in the history
…) is called, the call should be a no-op if request input parameters have already been read or if getReader() has been called. However, at present, check is there only in case of use of reader and no check if parameter has been read by a different method call (e.g by calling getParameter()). This seems to be a regression introduced during Grizzly 2.0 integration in revision 46674. Changes have been made to check if parameters have been processed/read too. character encoding will not be set if either parameters have been reader or reader is being used. Change has been reviewed and approved by Shing Wai Chan. Build, quick look and web-dev-test run went fine. CTS run planned post merge in trunk.

git-svn-id: https://svn.java.net/svn/glassfish~svn/trunk/main@64117 6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
  • Loading branch information
vivishal authored and Pandrex247 committed Oct 8, 2015
1 parent 3bf0ebb commit c1f008d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ public void setCharacterEncoding(String enc)
throws UnsupportedEncodingException {

// START SJSAS 4936855
if (usingReader) {
if (parametersProcessed || usingReader) {
String contextName =
getContext() != null ? getContext().getName() : "UNKNOWN";
log.log(Level.WARNING, UNABLE_SET_REQUEST_CHARS, new Object[] {enc, contextName});
Expand Down

0 comments on commit c1f008d

Please sign in to comment.