response.hasHeader(name)


如果当前在传出的响应头中设置了由 name 标识的响应头,则返回 true。 请注意,响应头名称匹配不区分大小写。

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

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

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