Socket
Socket
Sign inDemoInstall

media-type

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

4

lib/mediaType.js

@@ -85,3 +85,3 @@ /**

var mediaTypeMatcher = /^(application|audio|image|message|model|multipart|text|video)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/;
var mediaTypeMatcher = /^(application|audio|image|message|model|multipart|text|video|\*)\/([a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]{1,127})(;.*)?$/;

@@ -94,3 +94,3 @@ var parameterSplitter = /;(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/;

var match = str.match(mediaTypeMatcher);
if (match) {
if (match && !(match[1] === '*' && match[2] !== '*')) {
mediaType.type = match[1];

@@ -97,0 +97,0 @@ mediaType._setSubtypeAndSuffix(match[2]);

{
"name": "media-type",
"version": "0.2.0",
"version": "0.3.0",
"author": "Lovell Fuller <npm@lovell.info>",
"contributors": [
"Doug Luce <aluce@adonnetwork.com> (https://github.com/dougluce)"
],
"main": "./lib/mediaType",
"description": "Parse and validate RFC6838 media types, anything from 'text/plain' to 'application/vnd.company.app.entity-v2+xml;charset=utf8'",
"scripts": {
"test": "node test/unit"
},
"repository": {

@@ -10,8 +17,2 @@ "type": "git",

},
"engines": {
"node": ">=0.10"
},
"scripts": {
"test": "node test/unit"
},
"keywords": [

@@ -28,4 +29,6 @@ "media",

],
"author": "Lovell Fuller",
"license": "Apache 2.0"
"license": "Apache 2.0",
"engines": {
"node": ">=0.10"
}
}
# media-type
Node.js module to parse and validate [RFC6838](http://tools.ietf.org/html/rfc6838) media types.
Node.js module to parse and validate
[RFC6838](http://tools.ietf.org/html/rfc6838) media types.
Useful for parsing `Content-Type` HTTP response headers from [HATEOAS](http://en.wikipedia.org/wiki/HATEOAS) constrained services.
Useful for parsing `Content-Type` HTTP response headers
from [HATEOAS](http://en.wikipedia.org/wiki/HATEOAS) constrained services.
Aware of vendor subtype trees, +suffixes and semicolon delimited parameters.
Aware of vendor subtype trees, +suffixes, wildcards and semicolon delimited parameters.

@@ -87,3 +89,3 @@ ## Install

Copyright 2013, 2014 Lovell Fuller
Copyright 2013, 2014, 2015 Lovell Fuller and contributors

@@ -90,0 +92,0 @@ Licensed under the Apache License, Version 2.0 (the "License");

@@ -68,4 +68,8 @@ /**

// https://twitter.com/fcw/status/398604109525184512
"application/LD+JSON-SQL*CSV.1"
"application/LD+JSON-SQL*CSV.1",
// wildcards from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
"*/*",
"audio/*"
].forEach(function(value) {

@@ -89,2 +93,4 @@ var type = mediaType.fromString(value);

"text/plain,wrong",
"*",
"*/plain",

@@ -91,0 +97,0 @@ // https://bugs.launchpad.net/kde-baseapps/+bug/570832

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc