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

@qpoint/mask-urls

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qpoint/mask-urls - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

1

lib/index.d.ts

@@ -7,3 +7,4 @@ import { Context } from '@qpoint/router';

appUrl?: string;
maskAssets?: boolean;
}
export default function rewriteHtml(config?: MaskUrlsConfig): (ctx: Context, next: Function) => any;

16

lib/index.js

@@ -18,8 +18,16 @@ "use strict";

config = ctx.state['mask-urls.config'];
// attach to the rewriter
// generate an assets config
const assetsConfig = {
...config,
...(!config.maskAssets && {
absolute: true,
edgeUrl: config.edgeUrl || config.appUrl || ctx.pxy.url
}),
};
// add rewrite rules
ctx.htmlRewriter
.on("a", new url_rewriter_1.UrlRewriter('href', ctx, config))
.on("link", new url_rewriter_1.UrlRewriter('href', ctx, config))
.on("img", new url_rewriter_1.UrlRewriter('src', ctx, config))
.on("script", new url_rewriter_1.UrlRewriter('src', ctx, config));
.on("link", new url_rewriter_1.UrlRewriter('href', ctx, assetsConfig))
.on("img", new url_rewriter_1.UrlRewriter('src', ctx, assetsConfig))
.on("script", new url_rewriter_1.UrlRewriter('src', ctx, assetsConfig));
// continue along

@@ -26,0 +34,0 @@ return next();

{
"name": "@qpoint/mask-urls",
"version": "0.1.1",
"version": "0.1.2",
"description": "A Qpoint adapter for masking URLs behind a reverse proxy",

@@ -5,0 +5,0 @@ "author": "Tyler Flint <tyler@qpoint.io>",

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