mirror of
https://github.com/apple/swift-http-types
synced 2026-11-30 05:18:47 +00:00
Fix relative URL
This commit is contained in:
1 parent
6861b096b0
commit
4b54b0f292
1 file changed
+1
-1
@@ -84,7 +84,7 @@ extension URL {
|
||||
|
||||
fileprivate var httpRequestComponents: (scheme: [UInt8], authority: [UInt8]?, path: [UInt8]) {
|
||||
// CFURL parser based on byte ranges does not unnecessarily percent-encode WHATWG URL
|
||||
let url = unsafeBitCast(self as NSURL, to: CFURL.self)
|
||||
let url = unsafeBitCast(self.absoluteURL as NSURL, to: CFURL.self)
|
||||
let length = CFURLGetBytes(url, nil, 0)
|
||||
return withUnsafeTemporaryAllocation(of: UInt8.self, capacity: length) { buffer in
|
||||
CFURLGetBytes(url, buffer.baseAddress, buffer.count)
|
||||
|
||||
Reference in new issue
Block a user