574a16d9fa
Snapshot of the working tree before cleanup. Captures: - Keysat licensing: server/license.js, /api/license/* endpoints in server/index.js, activation modal in public/index.html, embedded Ed25519 issuer key (assets/issuer.pub). - StartOS 0.4 expansion: setApiKey action, version files v0.1.1 through v0.1.15, file-models/config.json.ts, manifest updates. - Self-hosted registry server (startos-registry/). - Build/deploy scripts (bin/bump-version.sh, bin/deploy.sh, vendored yt-dlp binary), .gitignore, .deploy.env.example. - Recent design docs (KEYSAT_INTEGRATION.md, UPGRADE-DESIGN.md) — retained here so they remain recoverable when removed in the follow-up cleanup commit.
48 lines
885 B
JavaScript
48 lines
885 B
JavaScript
/*!
|
|
* 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.
|
|
*/
|
|
|
|
var merge = require('utils-merge')
|
|
var parseUrl = require('parseurl');
|
|
var qs = require('qs');
|
|
|
|
/**
|
|
* @param {Object} options
|
|
* @return {Function}
|
|
* @api public
|
|
*/
|
|
|
|
module.exports = function query(options) {
|
|
var opts = merge({}, options)
|
|
var queryparse = qs.parse;
|
|
|
|
if (typeof options === 'function') {
|
|
queryparse = options;
|
|
opts = undefined;
|
|
}
|
|
|
|
if (opts !== undefined && opts.allowPrototypes === undefined) {
|
|
// back-compat for qs module
|
|
opts.allowPrototypes = true;
|
|
}
|
|
|
|
return function query(req, res, next){
|
|
if (!req.query) {
|
|
var val = parseUrl(req).query;
|
|
req.query = queryparse(val, opts);
|
|
}
|
|
|
|
next();
|
|
};
|
|
};
|