[Pkg-javascript-commits] [node-mocks-http] 141/296: fixed; mockRequest - `.session` should default to undefined
Thorsten Alteholz
alteholz at moszumanska.debian.org
Mon Feb 8 18:13:30 UTC 2016
This is an automated email from the git hooks/post-receive script.
alteholz pushed a commit to branch master
in repository node-mocks-http.
commit 78f96fac0d896dc058c0eba4212f07d318fa4f77
Author: Johnny Estilles <johnny.estilles at agentia.asia>
Date: Tue Mar 24 12:10:17 2015 +0800
fixed; mockRequest - `.session` should default to undefined
---
lib/mockRequest.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/mockRequest.js b/lib/mockRequest.js
index bae87e0..a41f6ba 100644
--- a/lib/mockRequest.js
+++ b/lib/mockRequest.js
@@ -44,7 +44,9 @@ function createRequest(options) {
mockRequest.url = (options.url) ? options.url : '';
mockRequest.path = (options.url) ? url.parse(options.url).pathname : '';
mockRequest.params = (options.params) ? options.params : {};
- mockRequest.session = (options.session) ? options.session : {};
+ if (options.session) {
+ mockRequest.session = options.session;
+ }
mockRequest.cookies = (options.cookies) ? options.cookies : {};
mockRequest.headers = (options.headers) ? options.headers : {};
mockRequest.body = (options.body) ? options.body : {};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocks-http.git
More information about the Pkg-javascript-commits
mailing list