/**
  * Add a header entry for the given name.
  *
  * <p>If there was no entry for that header name before, the value will be used as-is. In case of
  * an existing entry, a String array will be created, adding the given value (more specifically,
  * its toString representation) as further element.
  *
  * <p>Multiple values can only be stored as list of Strings, following the Servlet spec (see
  * <code>getHeaders</code> accessor). As alternative to repeated <code>addHeader</code> calls for
  * individual elements, you can use a single call with an entire array or Collection of values as
  * parameter.
  *
  * @see #getHeaderNames
  * @see #getHeader
  * @see #getHeaders
  * @see #getDateHeader
  * @see #getIntHeader
  */
 public void addHeader(String name, Object value) {
   if (CONTENT_TYPE_HEADER.equalsIgnoreCase(name)) {
     setContentType((String) value);
     return;
   }
   doAddHeaderValue(name, value, false);
 }
 private void updateContentTypeHeader() {
   if (this.contentType != null) {
     StringBuilder sb = new StringBuilder(this.contentType);
     if (this.contentType.toLowerCase().indexOf(CHARSET_PREFIX) == -1
         && this.characterEncoding != null) {
       sb.append(";").append(CHARSET_PREFIX).append(this.characterEncoding);
     }
     doAddHeaderValue(CONTENT_TYPE_HEADER, sb.toString(), true);
   }
 }