schlagmichdoch / PairDrop

PairDrop: Local file sharing in your browser. Inspired by Apple's AirDrop. Fork of Snapdrop.
https://pairdrop.net
GNU General Public License v3.0
3.66k stars 193 forks source link

[Enhancement] If using client mode, do not send peers from another ws-domain #269

Open schlagmichdoch opened 4 months ago

schlagmichdoch commented 4 months ago

Describe the bug Currently, peer secrets are saved in one database without specifying the websocket domain they are used with. This is not a problem for normal operation, as the IndexedDB databases are specific to each domain.

Expected behavior To prevent sending secrets not created by the websockets specified via the client mode, we should add an entry ws-domain to the table and save the currently used websocket domain to it. Then, when connecting to a websocket, only those peer secrets belonging to the ws-domain or rather always only get those room secrets that belong to the websocket domain via the PersistentStorage class.