Skip to content

Commit

Permalink
perf: improve Accept parsing speed
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed May 3, 2016
1 parent 72be879 commit 1cd03e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY.md
@@ -1,6 +1,7 @@
unreleased
==========

* perf: improve `Accept` parsing speed
* perf: improve `Accept-Charset` parsing speed
* perf: improve `Accept-Encoding` parsing speed
* perf: improve `Accept-Language` parsing speed
Expand Down
2 changes: 1 addition & 1 deletion lib/mediaType.js
Expand Up @@ -21,7 +21,7 @@ module.exports.preferredMediaTypes = preferredMediaTypes;
* @private
*/

var simpleMediaTypeRegExp = /^\s*(\S+?)\/([^;\s]+)\s*(?:;(.*))?$/;
var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;

/**
* Parse the Accept header.
Expand Down

0 comments on commit 1cd03e5

Please sign in to comment.