Skip to content

Commit 83aca5c

Browse files
committed
Always parse with forward slash
1 parent 198059e commit 83aca5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/FoundationEssentials/URL/URLParser.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ internal struct RFC3986Parser: URLParserProtocol {
588588
/// Parses a URL string into `URLParseInfo`, with the option to add (or skip) encoding of invalid characters.
589589
/// If `encodingInvalidCharacters` is `true`, this function handles encoding of invalid components.
590590
static func parse(urlString: String, encodingInvalidCharacters: Bool) -> URLParseInfo? {
591+
#if os(Windows)
592+
let urlString = urlString.replacing(UInt8(ascii: "\\"), with: UInt8(ascii: "/"))
593+
#endif
591594
guard let parseInfo = parse(urlString: urlString) else {
592595
return nil
593596
}

0 commit comments

Comments
 (0)