Skip to content

nostr: harden RelayUrl::parse - #1451

Merged
yukibtc merged 2 commits into
masterfrom
nostr-max-relay-url-size
Aug 18, 2026
Merged

nostr: harden RelayUrl::parse #1451
yukibtc merged 2 commits into
masterfrom
nostr-max-relay-url-size

Conversation

@yukibtc

@yukibtc yukibtc commented Aug 18, 2026

Copy link
Copy Markdown
Member

Checklist

  • I followed the contribution guidelines
  • I updated the relevant CHANGELOG.md (if applicable)
  • I understand and can explain all code in this PR

@yukibtc
yukibtc requested a review from TheAwiteb as a code owner August 18, 2026 06:20
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
@yukibtc
yukibtc force-pushed the nostr-max-relay-url-size branch from e750935 to bf6448b Compare August 18, 2026 06:20
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread nostr/src/types/url.rs
// Check if "://" appears more than once in the URL.
// Instead of using "count", we use the "next", to avoid iterating over the entire string.
let mut matches = url.matches("://");
if let (Some(_), Some(_)) = (matches.next(), matches.next()) {

@TheAwiteb TheAwiteb Aug 18, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I like it

@TheAwiteb TheAwiteb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise, it's LGTM

Comment thread nostr/src/types/url.rs

@TheAwiteb TheAwiteb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@yukibtc
yukibtc merged commit 6969fdb into master Aug 18, 2026
43 checks passed
@yukibtc
yukibtc deleted the nostr-max-relay-url-size branch August 18, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants