lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit be9db78e060ebc0000fa7827ac32efa3f6504f53
parent cb00b55db5cb194332b8cc4e505ee2c547beb102
Author: triesap <tyson@radroots.org>
Date:   Tue, 25 Aug 2026 22:30:30 +0000

transport-nostr: qualify canonical policy keys

- exercise root URLs carrying a query
- exercise root URLs carrying a fragment
- preserve exact configured endpoint identity
- restore the governed branch coverage floor

Diffstat:
Mcrates/transport_nostr/src/relay.rs | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/crates/transport_nostr/src/relay.rs b/crates/transport_nostr/src/relay.rs @@ -415,8 +415,18 @@ mod tests { let root = Url::parse("wss://relay.example/").expect("root URL"); let path = Url::parse("wss://relay.example/path/").expect("path URL"); + let query = Url::parse("wss://relay.example/?scope=write").expect("query URL"); + let fragment = Url::parse("wss://relay.example/#status").expect("fragment URL"); assert_eq!(configured_policy_key(&root), "wss://relay.example"); assert_eq!(configured_policy_key(&path), "wss://relay.example/path/"); + assert_eq!( + configured_policy_key(&query), + "wss://relay.example/?scope=write" + ); + assert_eq!( + configured_policy_key(&fragment), + "wss://relay.example/#status" + ); } #[test]