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

mvcfun

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mvcfun - npm Package Compare versions

Comparing version 0.4.2-r5 to 0.4.3

39

lib/request/Data.js

@@ -59,2 +59,16 @@ /**

/**
* Contains the authorization informations.
*
* {
* user: The name of the authentificating user.
* pass: The password.
* type: The authorization type, e.g. basic
* }
*
* @var {Object}
* @protected
*/
this._auth = null;
if (req.url) {

@@ -101,2 +115,13 @@ var tmp = url.parse(req.url, true);

if (req.headers.authorization) {
var tmp = req.headers.authorization.split(" ");
if (tmp[0] == 'Basic') {
this._auth = {type: tmp[0]};
var tmp = new Buffer(tmp[1], 'base64').toString().split(':');
this._auth.user = tmp[0];
this._auth.pass = tmp[1];
}
// TODO: Digest
}
/**

@@ -231,4 +256,18 @@ * Contains the request method (GET, POST ...)

/**
* The authorization informations.
*
* user, pass, type
*
* @member {Object} path
* @readonly
*/
nepp.createGS(module.exports.prototype, 'auth',
function getAuth() {
return this._auth;
}
);
// }}}
nepp(module.exports.prototype);

14

lib/response/Manager.js

@@ -154,9 +154,18 @@ /**

* @param {http.ServerResponse} resp Reponse Object.
* @param {String} realm The realm.
* @param {String} type The auth type. Defaults to basic.
* @param {String} language The language of the content.
*/
module.exports.prototype.writeUnauthorized = function(resp, language) {
module.exports.prototype.writeUnauthorized = function(resp, realm, type, language) {
VC.instance_of(resp, 'resp', http.ServerResponse);
if (type)
type = VC.string(type, 'type', 1);
else
type = 'Basic';
VC.string(realm, 'realm', 1);
var header = this._createHeader(language);
header['WWW-Authenticate'] = type + ' realm="' + realm + '"';
resp.writeHead(
HTTPStatusCodes.UNAUTHORIZED,
this._createHeader(language)
header
);

@@ -211,2 +220,3 @@ resp.end(this._prepareErrorMessage('Authorization Required'));

/**

@@ -213,0 +223,0 @@ * The charset that will be used for all responses.

2

package.json
{
"name": "mvcfun",
"version": "0.4.2r5",
"version": "0.4.3",
"description": "MVC based web server framework",

@@ -5,0 +5,0 @@ "main": "index.js",

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