🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@arcjet/env

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcjet/env - npm Package Compare versions

Comparing version
1.3.1
to
1.4.0
+15
-7
index.js

@@ -67,3 +67,2 @@ /**

"https://fly.decide.arcjettest.com",
"https://decide.arcjet.orb.local",
// Allow trailing slashes

@@ -74,3 +73,2 @@ "https://decide.arcjet.com/",

"https://fly.decide.arcjettest.com/",
"https://decide.arcjet.orb.local/",
];

@@ -86,7 +84,17 @@ /**

function baseUrl(environment) {
// Use ARCJET_BASE_URL if it is set and belongs to our allowlist; otherwise
// use the hardcoded default.
if (typeof environment["ARCJET_BASE_URL"] === "string" &&
baseUrlAllowed.includes(environment["ARCJET_BASE_URL"])) {
return environment["ARCJET_BASE_URL"];
// Use ARCJET_BASE_URL if it is set and belongs to our allowlist or has a
// hostname ending in .orb.local; otherwise use the hardcoded default.
if (typeof environment["ARCJET_BASE_URL"] === "string") {
if (baseUrlAllowed.includes(environment["ARCJET_BASE_URL"])) {
return environment["ARCJET_BASE_URL"];
}
try {
const hostname = new URL(environment["ARCJET_BASE_URL"]).hostname;
if (hostname.endsWith(".orb.local")) {
return environment["ARCJET_BASE_URL"];
}
}
catch {
// Invalid URL, fall through to default.
}
}

@@ -93,0 +101,0 @@ // If we're running on fly.io, use the Arcjet Decide Service hosted on fly

{
"name": "@arcjet/env",
"version": "1.3.1",
"version": "1.4.0",
"description": "Arcjet environment detection",

@@ -46,4 +46,4 @@ "keywords": [

"devDependencies": {
"@arcjet/eslint-config": "1.3.1",
"@arcjet/rollup-config": "1.3.1",
"@arcjet/eslint-config": "1.4.0",
"@arcjet/rollup-config": "1.4.0",
"@rollup/wasm-node": "4.59.0",

@@ -50,0 +50,0 @@ "eslint": "9.39.3",