New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ladjs/proxy

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ladjs/proxy - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

14

index.js

@@ -18,2 +18,5 @@ const http = require('http');

},
// useful option if you don't need https redirect
// (e.g. it's just a certbot server)
redirect: true,
...config

@@ -38,8 +41,9 @@ };

router.use((req, res) => {
res.writeHead(301, {
Location: parse(`https://${req.headers.host}${req.url}`).href
if (this.config.redirect)
router.use((req, res) => {
res.writeHead(301, {
Location: parse(`https://${req.headers.host}${req.url}`).href
});
res.end();
});
res.end();
});

@@ -46,0 +50,0 @@ this.server = http.createServer((req, res) => {

{
"name": "@ladjs/proxy",
"description": "Proxy for Lad",
"version": "1.0.0",
"version": "1.0.1",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",

@@ -6,0 +6,0 @@ "ava": {

@@ -6,2 +6,9 @@ const test = require('ava');

test('starts and stops server', async t => {
const proxy = new ProxyServer();
await proxy.listen();
await proxy.close();
t.pass();
});
test('redirects http to https', async t => {

@@ -16,2 +23,9 @@ const proxy = new ProxyServer();

test('does not redirect http to https', async t => {
const proxy = new ProxyServer({ redirect: false });
await proxy.listen();
const res = await request(proxy.server).get('/foobar');
t.is(res.status, 404);
});
test('serves acme challenge', async t => {

@@ -18,0 +32,0 @@ const config = {

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