Comparing version 0.4.3 to 0.4.4-r1
@@ -72,2 +72,12 @@ /** | ||
/** | ||
* The instance of the server which is running this controller. This will | ||
* be injected by the server itself on registering a controller. | ||
* See http.Server.prototype.addController for details. | ||
* | ||
* @protected | ||
* @var {http.Server} | ||
*/ | ||
this._server = null; | ||
/** | ||
* The current language of the controller. Has to be one of the iso strings | ||
@@ -220,2 +230,14 @@ * 'en', 'de', ... This will be added to any response header at run: | ||
/** | ||
* The server. | ||
* | ||
* @member {http.Server} server | ||
* @readonly | ||
*/ | ||
nepp.createGS(module.exports.prototype, 'server', | ||
function getServer() { | ||
return this._server | ||
} | ||
); | ||
/** | ||
* The session object. | ||
@@ -222,0 +244,0 @@ * |
@@ -311,2 +311,3 @@ /** | ||
module.exports.prototype.addController = function(controller) { | ||
controller._server = this; | ||
this.requestManager.requestController.addController(controller); | ||
@@ -313,0 +314,0 @@ }; |
@@ -24,2 +24,4 @@ /** | ||
* In controllers, use the log methods to emit this event. | ||
* 'error' Event: | ||
* Errors thrown will be caught an emitted using this event. | ||
* | ||
@@ -26,0 +28,0 @@ * @param {Object} respManagers Response manangers. |
@@ -151,2 +151,18 @@ /** | ||
/** | ||
* Write bad request to the response object. | ||
* | ||
* @param {http.ServerResponse} resp Reponse Object. | ||
* @param {String} language The language of the content. | ||
*/ | ||
module.exports.prototype.writeBadRequest = function(resp, err, language) { | ||
VC.instance_of(resp, 'resp', http.ServerResponse); | ||
resp.writeHead( | ||
HTTPStatusCodes.BAD_REQUEST, | ||
this._createHeader(language) | ||
); | ||
resp.end(this._prepareErrorMessage('Bad request')); | ||
}; | ||
/** | ||
* Writes unauthorized to the response object. | ||
@@ -153,0 +169,0 @@ * |
{ | ||
"name": "mvcfun", | ||
"version": "0.4.3", | ||
"version": "0.4.4r1", | ||
"description": "MVC based web server framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
167543
4728
26