mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
25
node_modules/express/lib/middleware/query.js
generated
vendored
25
node_modules/express/lib/middleware/query.js
generated
vendored
@@ -1,3 +1,13 @@
|
||||
/*!
|
||||
* express
|
||||
* Copyright(c) 2009-2013 TJ Holowaychuk
|
||||
* Copyright(c) 2013 Roman Shtylman
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
@@ -12,17 +22,28 @@ var qs = require('qs');
|
||||
*/
|
||||
|
||||
module.exports = function query(options) {
|
||||
var opts = Object.create(options || null);
|
||||
var queryparse = qs.parse;
|
||||
|
||||
if (typeof options === 'function') {
|
||||
queryparse = options;
|
||||
options = undefined;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
if (opts !== undefined) {
|
||||
if (opts.allowDots === undefined) {
|
||||
opts.allowDots = false;
|
||||
}
|
||||
|
||||
if (opts.allowPrototypes === undefined) {
|
||||
opts.allowPrototypes = true;
|
||||
}
|
||||
}
|
||||
|
||||
return function query(req, res, next){
|
||||
if (!req.query) {
|
||||
var val = parseUrl(req).query;
|
||||
req.query = queryparse(val, options);
|
||||
req.query = queryparse(val, opts);
|
||||
}
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user