Socket
Socket
Sign inDemoInstall

list-fetch

Package Overview
Dependencies
Maintainers
1
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

list-fetch - npm Package Compare versions

Comparing version 30.0.4 to 30.0.5

34

index.js

@@ -89,18 +89,2 @@ module.exports = async function makeBTFetch (opts = {}) {

function idFromHost(hn, hs, sp) {
if (hn.mainQuery) {
if (hs.has('x-update') || sp.has('x-update')) {
if (JSON.parse(hs.get('x-update') || sp.get('x-update'))) {
return { address: null, secret: null }
} else {
return { infohash: null }
}
} else {
return null
}
} else {
return hn.mainId
}
}
function formatReq (hostname, pathname, extra) {

@@ -291,6 +275,16 @@

const useData = idFromHost(mid, reqHeaders, searchParams)
if (!useData) {
return sendTheData(signal, { status: 400, headers: mainRes, body: mainReq ? `<html><head><title>${mid.mainLink}</title></head><body><div><p>invalid data</p></div></body></html>` : JSON.stringify('invalid data') })
if (mid.mainQuery) {
if (reqHeaders.has('x-update') || searchParams.has('x-update')) {
if (JSON.parse(reqHeaders.get('x-update') || searchParams.get('x-update'))) {
mid.mainId = { address: null, secret: null }
} else {
mid.mainId = { infohash: null }
}
} else {
return sendTheData(signal, { status: 400, headers: mainRes, body: mainReq ? `<html><head><title>${mid.mainLink}</title></head><body><div><p>invalid data</p></div></body></html>` : JSON.stringify('invalid data') })
}
} else {
return mid.mainId
}
const useOpt = reqHeaders.has('x-opt') || searchParams.has('x-opt') ? JSON.parse(reqHeaders.get('x-opt') || decodeURIComponent(searchParams.get('x-opt'))) : {}

@@ -302,3 +296,3 @@ const useOpts = {

const useBody = reqHeaders.has('content-type') && reqHeaders.get('content-type').includes('multipart/form-data') ? handleFormData(await request.formData()) : body
const torrentData = await app.publishTorrent(useData, mid.mainPath, useBody, useOpts)
const torrentData = await app.publishTorrent(mid.mainId, mid.mainPath, useBody, useOpts)
const useHeaders = {}

@@ -305,0 +299,0 @@ for (const test of ['sequence', 'name', 'infohash', 'dir', 'pair', 'secret', 'address']) {

{
"name": "list-fetch",
"version": "30.0.4",
"version": "30.0.5",
"description": "coming soon",

@@ -5,0 +5,0 @@ "main": "index.js",

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