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

combo-url-parser

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combo-url-parser - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

8

lib/middleware.js

@@ -12,3 +12,3 @@ var parser = require('./parser.js');

var headers = ['content-type', 'vary'].map(function (key) {
var headers = ['content-type', 'vary', 'access-control-allow-origin'].map(function (key) {
return [key, key.split('-').map(function (word) {

@@ -59,3 +59,3 @@ return word[0].toUpperCase() + word.substr(1)

if (err.message === '404') {
err.statsCde = 404;
err.statusCode = 404;
res.end('Sorry, Can not found '+ err.url);

@@ -78,7 +78,5 @@ } else {

res.setHeader('Access-Control-Allow-Origin', '*');
var newline = new Buffer('\n');
res.end(Buffer.concat(results.reduce(function(all, result){
res.end(Buffer.concat(results.reduce(function(all, result) {
if (all.length) {

@@ -85,0 +83,0 @@ all.push(newline);

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

"description": "A util to parser comboed url",
"version": "0.2.3",
"version": "0.2.4",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -30,4 +30,4 @@ var request = require('request');

it('body has content', function () {
expect(reqBody).to.be.ok();
expect(reqBody).to.be.a('string');
expect(reqBody).to.be.a('string')
.and.to.have.length(413)
});

@@ -60,9 +60,37 @@ });

it('body has content', function () {
expect(reqBody).to.be.ok();
expect(reqBody).to.be.a('string');
expect(reqBody).to.be.a('string')
.and.to.have.length(413);
});
});
});
describe('g.tbcdn.cn', function () {
var reqBody;
before(function (done) {
request({
uri: {
hostname: '10.125.202.112',
port: '',
pathname: '/kissy/k/1.4.1/seed.js',
protocol: 'http:'
},
headers: {
host: 't6l-tb-xcake-0-0-2.cdef.taobao.net',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.2 Safari/537.36'
}
}, function(err, req, body){
if (err) {
done(err);
return;
}
reqBody = body;
done();
});
});
it('body has content', function () {
expect(reqBody).to.be.a('string')
.and.to.have.length(199420);
});
});
});
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