@nka212bg/backend-utils 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/misc.js +3 -1
  2. package/package.json +1 -1
package/misc.js CHANGED
@@ -415,7 +415,9 @@ exports.urlMetadata = async ({ url }) => {
415
415
  const fxIndex = tempUrl.pathname.lastIndexOf(".");
416
416
  fileExtension = fxIndex < 0 ? null : tempUrl.pathname.substring(fxIndex + 1)?.match(/\w+/)[0];
417
417
 
418
- let fetchRes = await fetch(url);
418
+ let fetchRes = await fetch(url, {
419
+ headers: { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0" },
420
+ });
419
421
 
420
422
  const sizeKb = parseInt(Number(fetchRes.headers?.get("content-length")) / 1000);
421
423
  let contentType = fetchRes.headers?.get("content-type")?.split("/") || [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nka212bg/backend-utils",
3
3
  "author": "nka212bg",
4
- "version": "0.1.8",
4
+ "version": "0.1.9",
5
5
  "main": "index.js",
6
6
  "dependencies": {
7
7
  "@maxmind/geoip2-node": "^5.0.0",