summaryrefslogtreecommitdiff
path: root/runtime/js/11_workers.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-08-06 21:10:04 +0200
committerGitHub <noreply@github.com>2021-08-06 21:10:04 +0200
commit0d1a522a03c22749e96dab06ca7b3e8b428df701 (patch)
tree742f0f5495db3ef306b94b078957336c764fbbc7 /runtime/js/11_workers.js
parent2b53602d3c798b68db4ce986546d3434b986096a (diff)
revert: allow URL for permissions (#11600)
Revert changes to "net" permissions in regards to handling URLs introduced in 15b0e61de.
Diffstat (limited to 'runtime/js/11_workers.js')
-rw-r--r--runtime/js/11_workers.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js
index a0385357d..b59832635 100644
--- a/runtime/js/11_workers.js
+++ b/runtime/js/11_workers.js
@@ -94,9 +94,10 @@
value = ArrayPrototypeMap(value, (route) => {
if (route instanceof URL) {
if (permission === "net") {
- route = route.host;
- }
- if (permission === "env") {
+ throw new Error(
+ `Expected 'string' for net permission, received 'URL'`,
+ );
+ } else if (permission === "env") {
throw new Error(
`Expected 'string' for env permission, received 'URL'`,
);
@@ -124,12 +125,12 @@
write = "inherit",
}) {
return {
- env: parseArrayPermission(env, "env"),
+ env: parseUnitPermission(env, "env"),
hrtime: parseUnitPermission(hrtime, "hrtime"),
net: parseArrayPermission(net, "net"),
plugin: parseUnitPermission(plugin, "plugin"),
read: parseArrayPermission(read, "read"),
- run: parseArrayPermission(run, "run"),
+ run: parseUnitPermission(run, "run"),
write: parseArrayPermission(write, "write"),
};
}