/**
 * Accept JSON requests with optional media-type parameters while rejecting
 * look-alike types such as application/jsonp or application/json-patch+json.
 */
export function isApplicationJson(contentType: string | null): boolean {
  if (!contentType) return false;
  const [mediaType] = contentType.split(';', 1);
  return mediaType?.trim().toLowerCase() === 'application/json';
}
