Comparing version 2.1.0 to 2.2.0
@@ -29,3 +29,3 @@ 'use strict'; | ||
function setCookie(res, name, value, opts) { | ||
return res.addHeader('Set-Cookie', serializeCookie(name, value, opts)); | ||
return res.header('Set-Cookie', serializeCookie(name, value, opts)); | ||
} module.exports.setCookie = setCookie; | ||
@@ -32,0 +32,0 @@ |
@@ -9,3 +9,2 @@ 'use strict'; | ||
var respond = require('quinn-respond'); | ||
var mod$0 = require('quinn-respond');var notFound = mod$0.notFound;var internalServerError = mod$0.internalServerError; | ||
@@ -24,4 +23,4 @@ var getRequestContextNS = require('./context').getRequestContextNS; | ||
return err ? | ||
internalServerError(err.stack) : | ||
notFound(("Cannot " + req.method + " " + req.url + "\n")); | ||
respond.text(err.stack).status(500) : | ||
respond.text(("Cannot " + req.method + " " + req.url + "\n")).status(404); | ||
} | ||
@@ -33,2 +32,9 @@ | ||
function applyDefaults(res) { | ||
if (!res.hasHeader('Content-Type')) { | ||
res.setHeader('Content-Type', 'text/plain; charset=utf-8'); | ||
} | ||
return res; | ||
} | ||
function quinn(handler, errorHandler, fatalHandler) { | ||
@@ -61,3 +67,3 @@ debug('init'); | ||
.then(respond) | ||
.then(function(r) {return r.resolved();}) | ||
.then(applyDefaults) | ||
.then(partial(pipeTo, res)) | ||
@@ -64,0 +70,0 @@ .catch(partial(fatalHandler, req)) |
{ | ||
"name": "quinn", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Maybe coming some day.", | ||
@@ -22,3 +22,3 @@ "main": "dist/quinn.js", | ||
"minimist": "^0.1.0", | ||
"quinn-respond": "^1.0.0", | ||
"quinn-respond": "^2.0.0", | ||
"resolve-deep": "^1.0.1" | ||
@@ -25,0 +25,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9488
186
1
+ Addedquinn-respond@2.0.1(transitive)
- Removedquinn-respond@1.0.1(transitive)
Updatedquinn-respond@^2.0.0