Http2ServerResponse.prototype.hasHeader - Node documentation
method Http2ServerResponse.prototype.hasHeader

Usage

import { Http2ServerResponse } from "node:http2";

Returns true if the header identified by name is currently set in the outgoing headers. The header name matching is case-insensitive.

const hasContentType = response.hasHeader('content-type');

Parameters

name: string

Return Type

boolean