Do not hide WebSocket API when missing permission (#6186)

This commit is contained in:
Mm2PL
2025-05-04 12:49:08 +02:00
committed by GitHub
parent f282e30f1e
commit c7e1c2e812
4 changed files with 13 additions and 7 deletions
+6 -1
View File
@@ -786,9 +786,14 @@ TEST_F(PluginTest, testWebSocketNoPerms)
configure();
bool res = lua->script(R"lua(
return c2["WebSocket"] == nil
return c2["WebSocket"] ~= nil
)lua");
ASSERT_TRUE(res);
const char *shouldThrow = R"lua(
return c2.WebSocket.new('wss://127.0.0.1:9050/echo')
)lua";
EXPECT_ANY_THROW(lua->script(shouldThrow));
}
TEST_F(PluginTest, testWebSocketApi)