Skip to content

Commit 5851e5e

Browse files
committed
fix!: make host optional
This PR fixes the current implementation considering a host is mandatory in the Url. Yet this is incorrect as some schema don't require a host (ex: `file://`). This fix introduce a breaking change both for the Rust crate and the Python package.
1 parent 01601fe commit 5851e5e

File tree

5 files changed

+76
-55
lines changed

5 files changed

+76
-55
lines changed

faup/src/grammar.pest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
url = ${ SOI ~ scheme ~ "://" ~ userinfo? ~ host ~ (":" ~ port)? ~ path? ~ query? ~ fragment? ~ EOI }
1+
url = ${ SOI ~ scheme ~ "://" ~ userinfo? ~ host? ~ (":" ~ port)? ~ path? ~ query? ~ fragment? ~ EOI }
22
scheme = { ASCII_ALPHANUMERIC+ }
33

44
username = ${ (!(":" | "@" | "/" | "?" | "#" | "[" | "]" | WHITE_SPACE) ~ ANY)+ }

0 commit comments

Comments
 (0)