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

hrt

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hrt - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

40

main.js

@@ -83,29 +83,31 @@

var serverRoot = /^https?:\/\//.test(url) ? '' : CONFIG.serverRoot;
if (from) {
var serverRoot = /^https?:\/\//.test(url) ? '' : CONFIG.serverRoot;
var to = Util.rewrite(map, from, serverRoot);
var to = Util.rewrite(map, from, serverRoot);
// rewrite
if(from !== to){
Util.info('[rewrite] ' + url + ' -> ' + to);
// rewrite
if(from !== to){
Util.info('[rewrite] ' + url + ' -> ' + to);
// local file
if (!/^https?:\/\//.test(to)) {
if (merge) {
merge.call(me, to, function(contentType, buffer) {
setResponse(response, contentType, buffer);
});
// local file
if (!/^https?:\/\//.test(to)) {
if (merge) {
merge.call(me, to, function(contentType, buffer) {
setResponse(response, contentType, buffer);
});
return;
}
var contentType = Mime.lookup(to);
var buffer = Util.readFileSync(to);
setResponse(response, contentType, buffer);
return;
}
var contentType = Mime.lookup(to);
var buffer = Util.readFileSync(to);
setResponse(response, contentType, buffer);
// remote URL
request.pipe(Request(to)).pipe(response);
return;
}
// remote URL
request.pipe(Request(to)).pipe(response);
return;
}

@@ -112,0 +114,0 @@

{
"name": "hrt",
"version": "1.0.4",
"version": "1.0.5",
"description": "HTTP Rewrite Tool for Frontend",

@@ -5,0 +5,0 @@ "author": "Longhao Luo <lhluo@tudou.com>",

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