Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/originweave-core/src/lib.rs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 CHANGELOG not updated for behavior change

The repository contract requires CHANGELOG.md updates for behavior changes, but the actual diff touches only lib.rs and the new test. The PR description claims a three-file diff including CHANGELOG.md; that file is absent from the change.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ fn parse_bracketed_ipv6(authority: &str) -> Result<(String, Option<u16>, bool),
}

fn parse_port(port_text: &str) -> Result<u16, OriginError> {
if port_text.is_empty() || !port_text.bytes().all(|byte| byte.is_ascii_digit()) {
return Err(OriginError::InvalidPort);
}
let port = port_text
.parse::<u16>()
.map_err(|_error| OriginError::InvalidPort)?;
Expand Down
18 changes: 18 additions & 0 deletions crates/originweave-core/tests/origin_port_syntax.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use originweave_core::{Origin, OriginError};

#[test]
fn origin_rejects_non_digit_port_prefixes() {
for input in [
"https://example.com:+443",
"https://example.com:+8443",
"http://localhost:+80",
"http://127.0.0.1:+8080",
"https://[2001:db8::1]:+443",
] {
assert_eq!(
Origin::parse(input),
Err(OriginError::InvalidPort),
"input={input}"
);
Comment thread
seonghobae marked this conversation as resolved.
}
}
Loading