Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@hijup/check-header

hijup4CC0-1.01.0.1

Check if a header name or header value is valid.

check, http, header, valid, token, name, field, value, node, common, spec

readme

check-header

Check if a header name or header value is valid.

https://tools.ietf.org/html/rfc7230#section-3.2.6

This is a simpler version of node's internal optimized header validation and should stay compatible with it. If the corresponding tests are not updated with node's tests, please open an issue or submit a PR.

install

$ npm install check-header

example

import { validHeaderName, validHeaderValue } from 'check-header'

validHeaderName('foo') // => true
validHeaderName('@@') // => false

validHeaderValue('hey') // => true
validHeaderValue('中文呢') // => false

changelog

Changelog

1.0.1

  • [Refactor] Use RegExp constructor to create token at valid-header-name.js.
  • [Chore] Add CHANGELOG.md.
  • [Chore] Add .nvmrc to lockdown node.js version.