apple / swift-http-types

Version-independent HTTP currency types for Swift
Apache License 2.0
894 stars 47 forks source link

Hit false precondition when calling `HTTPRequest(url:)` with an URL which has base URL #16

Closed li-bei closed 1 year ago

li-bei commented 1 year ago
let baseURL = URL(string: "https://foo.com")!
let url = URL(string: "/bar", relativeTo: baseURL)!
let httpRequest = HTTPRequest(url: url)

will hit precondition in HTTPRequest+URL.swift:103:

precondition(schemeRange.location != kCFNotFound, "Schemeless URL is not supported")
guoye-zhang commented 1 year ago

Should be addressed in 0.2.1