Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Build Status][ci-image]][ci-url]
[![Coverage Status][coveralls-image]][coveralls-url]

Create and parse HTTP Content-Type header according to RFC 7231
Create and parse HTTP Content-Type header according to RFC 9110

## Installation

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"http",
"req",
"res",
"rfc7231"
"rfc9110"
],
"repository": "jshttp/content-type",
"funding": {
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/**
* RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
* RegExp to match *( ";" parameter ) in RFC 9110 sec 8.3.1
*
* parameter = token "=" ( token / quoted-string )
* token = 1*tchar
Expand All @@ -25,20 +25,20 @@ const TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/; // eslint-disable-l
const TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;

/**
* RegExp to match quoted-pair in RFC 7230 sec 3.2.6
* RegExp to match quoted-pair in RFC 9110 sec 5.6.4
*
* quoted-pair = "\\" ( HTAB / SP / VCHAR / obs-text )
* obs-text = %x80-FF
*/
const QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g; // eslint-disable-line no-control-regex

/**
* RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
* RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4
*/
const QUOTE_REGEXP = /([\\"])/g;

/**
* RegExp to match type in RFC 7231 sec 3.1.1.1
* RegExp to match type in RFC 9110 sec 8.3.1
*
* media-type = type "/" subtype
* type = token
Expand Down
Loading