New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-web-mvc

Package Overview
Dependencies
Maintainers
1
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-web-mvc - npm Package Compare versions

Comparing version 2.2.21 to 2.2.22

16

dist/servlets/http/HttpServletResponse.js

@@ -24,3 +24,3 @@ "use strict";

get: function () {
return this.nativeResponse.statusCode;
return this.tempStatusCode || this.nativeResponse.statusCode;
},

@@ -32,3 +32,3 @@ enumerable: false,

get: function () {
return this.nativeResponse.statusMessage;
return this.tempStatusMessage || this.nativeResponse.statusMessage;
},

@@ -45,2 +45,7 @@ enumerable: false,

});
HttpServletResponse.prototype.writeStatus = function () {
if (!this.headersSent) {
this.nativeResponse.writeHead(this.tempStatusCode, this.tempStatusMessage);
}
};
HttpServletResponse.prototype.setHeader = function (name, value) {

@@ -50,5 +55,4 @@ this.nativeResponse.setHeader(name, value);

HttpServletResponse.prototype.setStatus = function (status, statusMessage) {
if (!this.headersSent) {
this.nativeResponse.writeHead(status, statusMessage);
}
this.tempStatusCode = status;
this.tempStatusMessage = statusMessage;
return this;

@@ -60,5 +64,7 @@ };

HttpServletResponse.prototype.write = function (chunk, callback, encoding) {
this.writeStatus();
this.nativeResponse.write(chunk === undefined ? '' : chunk, encoding || 'utf-8', callback);
};
HttpServletResponse.prototype.end = function (data, encoding, callback) {
this.writeStatus();
this.nativeResponse.end(data, encoding, callback);

@@ -65,0 +71,0 @@ };

@@ -67,3 +67,5 @@ "use strict";

.catch(function (error) {
response.setStatus(500, error.message).end();
console.error(error);
response.setStatus(500, error.message).write(error.message || '');
response.end();
});

@@ -70,0 +72,0 @@ };

{
"name": "node-web-mvc",
"version": "2.2.21",
"version": "2.2.22",
"description": "node spring mvc",

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

@@ -6,3 +6,2 @@ /**

import { ServerResponse } from 'http';
import HttpServletRequest from './HttpServletRequest';
import ServletContext from './ServletContext';

@@ -12,2 +11,6 @@

private tempStatusCode;
private tempStatusMessage;
/**

@@ -41,3 +44,3 @@ * 当前请求对象

public get statusCode() {
return this.nativeResponse.statusCode;
return this.tempStatusCode || this.nativeResponse.statusCode;
}

@@ -49,3 +52,3 @@

public get statusMessage() {
return this.nativeResponse.statusMessage;
return this.tempStatusMessage || this.nativeResponse.statusMessage;
}

@@ -60,2 +63,8 @@

private writeStatus() {
if (!this.headersSent) {
this.nativeResponse.writeHead(this.tempStatusCode, this.tempStatusMessage);
}
}
/**

@@ -75,5 +84,4 @@ * 添加一个指定名称的返回头到返回头队列

setStatus(status, statusMessage?) {
if (!this.headersSent) {
this.nativeResponse.writeHead(status, statusMessage);
}
this.tempStatusCode = status;
this.tempStatusMessage = statusMessage;
return this;

@@ -95,2 +103,3 @@ }

write(chunk, callback?, encoding?) {
this.writeStatus();
this.nativeResponse.write(chunk === undefined ? '' : chunk, encoding || 'utf-8', callback);

@@ -104,2 +113,3 @@ }

end(data?, encoding?, callback?) {
this.writeStatus();
this.nativeResponse.end(data, encoding, callback);

@@ -106,0 +116,0 @@ }

@@ -101,3 +101,5 @@ /**

.catch((error) => {
response.setStatus(500, error.message).end();
console.error(error);
response.setStatus(500, error.message).write(error.message || '');
response.end();
})

@@ -104,0 +106,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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