NineSec Team Shell
Server IP : 92.205.26.207  /  Your IP : 216.73.216.16
Web Server : Apache
System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64
User : zikryat ( 1002)
PHP Version : 8.3.23
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/zikryat/public_html/node_modules/@socket.io/../prebuild-install/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/zikryat/public_html/node_modules/@socket.io/../prebuild-install/asset.js
const get = require('simple-get')
const util = require('./util')
const proxy = require('./proxy')

function findAssetId (opts, cb) {
  const downloadUrl = util.getDownloadUrl(opts)
  const apiUrl = util.getApiUrl(opts)
  const log = opts.log || util.noopLogger

  log.http('request', 'GET ' + apiUrl)
  const reqOpts = proxy({
    url: apiUrl,
    json: true,
    headers: {
      'User-Agent': 'simple-get',
      Authorization: 'token ' + opts.token
    }
  }, opts)

  const req = get.concat(reqOpts, function (err, res, data) {
    if (err) return cb(err)
    log.http(res.statusCode, apiUrl)
    if (res.statusCode !== 200) return cb(err)

    // Find asset id in release
    for (const release of data) {
      if (release.tag_name === opts['tag-prefix'] + opts.pkg.version) {
        for (const asset of release.assets) {
          if (asset.browser_download_url === downloadUrl) {
            return cb(null, asset.id)
          }
        }
      }
    }

    cb(new Error('Could not find GitHub release for version'))
  })

  req.setTimeout(30 * 1000, function () {
    req.abort()
  })
}

module.exports = findAssetId

NineSec Team - 2022