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-r4 to 0.4.2-r5

2

lib/controller/Base.js

@@ -167,3 +167,3 @@ /**

}
return this.requestController.responseManager;
return this.requestController.requestManager.responseManager;
}

@@ -170,0 +170,0 @@ );

@@ -53,6 +53,19 @@ /**

}
return this.requestController.responseManagers['application/json'];
return this.requestController.requestManager.responseManagers['application/json'];
}
);
/**
* Runs the controller.
*
* Writes directly to the given response object.
*
* @param http.ServerResponse resp Server response Object. Write your data into
* this object directly.
*/
module.exports.prototype.run = function(resp) {
VC.instance_of(resp, 'resp', http.ServerResponse);
this[this.request.method.toLowerCase()](resp);
};
module.exports.prototype.options = function(resp) {

@@ -86,13 +99,4 @@ this.responseManager.writeMethodNotAllowed(resp, 'options');

/**
* Runs the controller.
*
* Writes directly to the given response object.
*
* @param http.ServerResponse resp Server response Object. Write your data into
* this object directly.
*/
module.exports.prototype.run = function(resp) {
VC.instance_of(resp, 'resp', http.ServerResponse);
this[this.request.method](resp);
module.exports.prototype.put = function(resp) {
this.responseManager.writeMethodNotAllowed(resp, 'put');
};

@@ -79,3 +79,3 @@ /**

this.responseManagers = respManagers;
this._responseManagers = respManagers;
this._getDefaultRespManCb = getDefaultRespManCb;

@@ -82,0 +82,0 @@

{
"name": "mvcfun",
"version": "0.4.2r4",
"version": "0.4.2r5",
"description": "MVC based web server framework",

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

@@ -35,6 +35,21 @@ /**

var methods = mvcfun.http.Server.METHODS;
for (var i = 0; i < methods; ++i) {
for (var i = 0; i < methods.length; ++i) {
it('should return method not allowed [' + methods[i] + ']',
(function(method) {
return function(done) {
var httpresp = new http.ServerResponse(
{method: method}
);
httpresp.end = function(content) {
this.should.have.status(405);
done();
}
var ctrl = new mvcfun.controller.Rest(
'/filename'
);
reqCtrl.addController(ctrl);
reqMan._requestData = {
method: method
};
reqCtrl.run(httpresp, ctrl);
}

@@ -45,3 +60,2 @@ })(methods[i])

});
});

@@ -124,3 +124,3 @@ /**

method: method
}
};
reqCtrl.run(resp, ctrl);

@@ -127,0 +127,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