Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

content-type

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

content-type - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

5

HISTORY.md

@@ -0,1 +1,6 @@

1.0.1 / 2015-02-13
==================
* Improve missing `Content-Type` header error message
1.0.0 / 2015-02-01

@@ -2,0 +7,0 @@ ==================

6

index.js

@@ -109,5 +109,9 @@ /*!

// support req/res-like objects as argument
if (typeof string === 'object') {
// support req/res-like objects as argument
string = getcontenttype(string)
if (typeof string !== 'string') {
throw new TypeError('content-type header is missing from object');
}
}

@@ -114,0 +118,0 @@

2

package.json
{
"name": "content-type",
"description": "Create and parse HTTP Content-Type header",
"version": "1.0.0",
"version": "1.0.1",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -38,2 +38,4 @@ # content-type

Throws a `TypeError` if the string is missing or invalid.
### contentType.parse(req)

@@ -48,2 +50,4 @@

Throws a `TypeError` if the `Content-Type` header is missing or invalid.
### contentType.parse(res)

@@ -58,2 +62,4 @@

Throws a `TypeError` if the `Content-Type` header is missing or invalid.
### contentType.format(obj)

@@ -74,2 +80,4 @@

Throws a `TypeError` if the object contains an invalid type or parameter names.
## License

@@ -76,0 +84,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc