sylc
sylc2y ago

Allow-net not applying to npm: imports ?

Hi, Running the below does not ask me for a permission to access github.com.
import axios from "npm:axios"

await axios.get('https://github.com')
.then(function (response) {
// handle success
console.log(response);
}).catch(err => {
console.log(err)
})
import axios from "npm:axios"

await axios.get('https://github.com')
.then(function (response) {
// handle success
console.log(response);
}).catch(err => {
console.log(err)
})
The same occur if I use for example npm:@aws-sdk/client-s3 and try to access a bucket or using npm:node-fetch. No net access is requested. Does allow-net not apply to modules using npm: specifier ? Is there a way to enforce any npm import to request for net access ? deno version is 1.34.0 thanks
6 Replies
AapoAlas
AapoAlas2y ago
Hmm, I do not think this should be the case but I seem to see the same behaviour.
sylc
sylcOP2y ago
@aapoalas thanks for confirming. It seem also a bug to me but i wasn't sure if i missed something. Should i open an issue ?
AapoAlas
AapoAlas2y ago
Yeah, I think so.
sylc
sylcOP2y ago
GitHub
npm: imports not needing allow-net to make request · Issue #19301 ·...
Hi, Running the below does not ask me for an allow-net permission to access github.com. #!/usr/bin/env -S deno run --allow-read --allow-env import axios from "npm:axios" await axios.get(&...
bartlomieju
bartlomieju2y ago
This is already fixed on main, I will release it tomorrow
AapoAlas
AapoAlas2y ago
I had somehow missed this prior, sorry.

Did you find this page helpful?