Baroshem / nuxt-security

🛡 Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware
https://nuxt-security.vercel.app/
MIT License
737 stars 56 forks source link

feat: support reading from websockets #476

Closed GalacticHypernova closed 6 days ago

GalacticHypernova commented 1 week ago

Types of changes

Description

This is a WIP PR to add support for reading messages from websockets, fixing #472 . It relies on the underlying socket in the connection and is therefore experimental. Due to the inability to test the module locally as stackblitz always regenerated the necessary file, I am adding this here to experiment with.

Checklist:

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuxt-security ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 11:50am
GalacticHypernova commented 1 week ago

@Baroshem can we introduce some dependencies for some of the tests? (like websockets) Or should the module stay dependency-free?

Baroshem commented 1 week ago

@GalacticHypernova

Hey there! The best would be to remain deps free 🙂

GalacticHypernova commented 1 week ago

How would we test websockets in such case? Through nitro's built in websocket system?

GalacticHypernova commented 1 week ago

This will be refactored, the issue has been identified and is unrelated to the module, I'll open a PR in the responsible repo

Baroshem commented 1 week ago

Thanks for investigation @GalacticHypernova. Should we close this PR or remain as is?

GalacticHypernova commented 1 week ago

It depends. Would you like me to make a custom data reading method to not rely on h3's?

Baroshem commented 1 week ago

I dont think so. We are relying in H3 so I wouldnt test any other setup

GalacticHypernova commented 6 days ago

In that case we can close this, I forwarded the issue to h3 =)