Kong/insomnia · error · Error

contentInfo: mime type in header Content-Type is invalid

Error message

contentInfo: mime type in header Content-Type is invalid

What it means

Error "contentInfo: mime type in header Content-Type is invalid" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:111

    return '_kind' in obj && obj._kind === 'Response';
  }

  contentInfo(): ResponseContentInfo {
    const mimeInfo = {
      mimeType: 'application/octet-stream',
      mimeFormat: '', // TODO: it's definition is unknown
      charset: 'utf8',
    };

    const contentType = this.headers.find(header => header.key === 'Content-Type');
    if (contentType) {
      const directives = contentType.valueOf().split('; ');
      if (directives.length === 0) {
        throw new Error('contentInfo: header Content-Type value is blank');
      } else {
        const mimeType = directives[0];
        if (!mimeType) {
          throw new Error('contentInfo: mime type in header Content-Type is invalid');
        }
        mimeInfo.mimeType = mimeType;
        directives.forEach(dir => {
          if (dir.startsWith('charset')) {
            mimeInfo.charset = dir.slice(dir.indexOf('=') + 1);
          }
        });
      }
    }

    const fileInfo = {
      extension: '',
      name: 'unknown',
    };

    const contentDisposition = this.headers.find(header => header.key === 'Content-Disposition');
    if (contentDisposition) {
      const directives = contentDisposition.valueOf().split('; ');

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:111 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/5e8b872c0e3771b3. Report an issue: GitHub.