Kong/insomnia · error · Error

contentInfo: header Content-Type value is blank

Error message

contentInfo: header Content-Type value is blank

What it means

Defensive branch in Response.contentInfo: a Content-Type header exists but splitting it on '; ' yielded no directives — i.e. the header value is empty/blank. The MIME info cannot be derived from a blank Content-Type, so content inspection aborts.

Solutions

  1. Ensure the server sends a non-empty Content-Type header
  2. Strip the blank header in the script before calling contentInfo()
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/response.ts:107 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/32baee918fb2ee08. Report an issue: GitHub.

Appendix: source

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

    });
  }

  static isResponse(obj: object) {
    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',
    };

View on GitHub (pinned to d9bb2b0142)