Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

echoecho

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

echoecho - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

16

lib/echo.js

@@ -80,3 +80,3 @@ /*

},
serve: function (req, res) {
serve: function (req, res, config) {
var self = this,

@@ -87,7 +87,14 @@ base = this.validate(req),

query,
data;
data,
dirroot = __dirname;
config = config || {};
if (config.dirroot) {
dirroot = config.dirroot;
}
if (base && base !== true) {
if (this.scheme[base]) {
query = parse(req.url).query,
query = parse(req.url).query;
parsed = qs.parse(query);

@@ -98,4 +105,5 @@

} else if (parsed.file) {
filepath = path.join(__dirname, parsed.file);
filepath = path.join(dirroot, parsed.file);
fs.readFile(filepath, function (err, data) {
/*istanbul ignore next*/
if (err) {

@@ -102,0 +110,0 @@ self.scheme.status(404, res);

@@ -5,3 +5,3 @@ {

"author": "Dav Glass <davglass@gmail.com>",
"version": "0.1.8",
"version": "0.1.9",
"devDependencies": {

@@ -8,0 +8,0 @@ "vows": "*",

@@ -14,12 +14,16 @@ var vows = require('vows'),

var server = http.createServer(function(req, res) {
var conf = {
dirroot: __dirname
};
if (req.url.indexOf('-express') > -1) {
conf = null;
var p = parse(req.url);
req.url = req.url.replace('-express', '');
req.body = qs.parse(p.query);
echoecho.serve(req, res);
echoecho.serve(req, res, conf);
} else if (echoecho.handle(req)) {
echoecho.serve(req, res);
echoecho.serve(req, res, conf);
} else {
if (req.url.indexOf('skipthisrequest') > -1) {
echoecho.serve(req, res);
echoecho.serve(req, res, conf);
} else {

@@ -838,3 +842,3 @@ res.writeHead(200);

function assertFileParam(route, method) {
var path = '/foo/bar/baz/echo/' + route + '?file=../tests/fixtures/file.json'
var path = '/foo/bar/baz/echo/' + route + '?file=fixtures/file.json',
context = {

@@ -851,3 +855,3 @@ topic: function() {

assert.equal(res.body, file);
}
};

@@ -854,0 +858,0 @@ return context;

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