docs: synchronized protected void commit() {
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
              logger.entering(CLASS_NAME,"commit","["+this+"] ,_headersWritten -->" + _headersWritten );
          }
          // begin 134537: part 2
          // (!isCommitted())
          if (!_headersWritten && !isCommitted()) // add check if headersWritten
          {
              // end 134537: part 2
  
              addLocaleHeader();
  
              // PQ59244 - disallow content length header if content is encoded
              // LIBERTY
              if (containsHeader(HEADER_CONTENT_ENCODING) && containsHeader(HEADER_CONTENT_LENGTH)) {
  
                  if (keepContentLength){
                      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
                          logger.logp(Level.FINE, CLASS_NAME,"commit", "WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header");
                      }
                  }
                  else{   
                      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                          logger.logp(Level.FINE, CLASS_NAME,"commit", "Content-Length header disallowed w/presence of Content-Encoding header");
                      }
  
                      removeHeader(HEADER_CONTENT_LENGTH);
                  }
              }
  
              WebContainer.notifyHttpServletResponseListenersPreHeaderCommit((HttpServletRequest) _connContext.getRequest(), this);
  
              String scheme = this.getRequest().getScheme();            
              if(scheme!=null && scheme.equalsIgnoreCase("https")){
                  addSTSHeader();
              }
  
              _response.prepareHeadersForWrite();
  
              // begin 134537: part 3
              _headersWritten = true;
              // end 134537: part 3
              
              if(this._bufferedOut!= null && this._bufferedOut instanceof WCOutputStream){
                  HttpOutputStreamConnectWeb output = ((WCOutputStream) this._bufferedOut).getOutput();
                  output.setWebC_headersWritten(true);
                  
                  String remoteUser = _connContext.getRequest().getRemoteUser();
                  
                  if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                      logger.logp(Level.FINE, CLASS_NAME, "commit", "Setting remote user : " + remoteUser);
                  }
                  //Set the remote user to the channel. This will first try to get the security remote user and then fall back on the channel
                  output.setWC_remoteUser(remoteUser);
                  (((WCOutputStream) this._bufferedOut).getOutput()).setWebC_headersWritten(true);
               }
  
          }
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
              logger.exiting(CLASS_NAME,"commit");
          }
      }