code: public static String getResponseMimeType(String pRequestMimeType, String defaultMimeType, String pCallback) {
  
          // For a valid given callback, return "text/javascript" for proper inclusion
          if (pCallback != null && isValidCallback(pCallback)) {
              return "text/javascript";
          }
  
          // Pick up mime time from request, but sanitize
          if (pRequestMimeType != null) {
              return sanitize(pRequestMimeType);
          }
  
          // Use the given default mime type (possibly picked up from a configuration)
          return sanitize(defaultMimeType);
      }
docs: Extract the response mime type. This value is calculated for different situations:
  <p>
  <ul>
  <li>If a callback is given and its valid, the mime type is "text/javascript"</li>
  <li>Otherwise:
  <ul>
  <li>If a valid mimeType is given in the request ("text/plain", "application/json"), then this
  mimet type is returned</li>
  <li>If another mimeType is given, then "text/plain" is used</li>
  <li>If no mimeType is given then a given default mime type is used, but also sanitized
  as described above</li>
  </ul>
  </li>
  </ul>
  
  @param pRequestMimeType the mimetype given in the request
  @param defaultMimeType  the default mime type to use if none is given in the request
  @param pCallback        a callback given (can be null)