mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
remove trailing slashes and fix test failures
This commit is contained in:
parent
1abe5932ad
commit
f01d935bb1
7 changed files with 61 additions and 8 deletions
|
|
@ -97,12 +97,13 @@ export async function fetchNewPackagesList() {
|
|||
const ecosystem = getEcoSystem();
|
||||
const baseUrl = getMalwareListBaseUrl();
|
||||
const path = newPackagesListPaths[/** @type {keyof typeof newPackagesListPaths} */ (ecosystem)];
|
||||
const url = `${baseUrl}/${path}`;
|
||||
|
||||
if (!url) {
|
||||
if (!path) {
|
||||
return { newPackagesList: [], version: undefined };
|
||||
}
|
||||
|
||||
const url = `${baseUrl}/${path}`;
|
||||
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
|
|
@ -130,12 +131,13 @@ export async function fetchNewPackagesListVersion() {
|
|||
const ecosystem = getEcoSystem();
|
||||
const baseUrl = getMalwareListBaseUrl();
|
||||
const path = newPackagesListPaths[/** @type {keyof typeof newPackagesListPaths} */ (ecosystem)];
|
||||
const url = `${baseUrl}/${path}`;
|
||||
|
||||
if (!url) {
|
||||
if (!path) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const url = `${baseUrl}/${path}`;
|
||||
|
||||
const response = await fetch(url, { method: "HEAD" });
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue