mirror of
https://github.com/apple/swift-http-types
synced 2026-11-28 05:14:20 +00:00
Request.url should return nil for situations where it is not applicable (#84)
Regular CONNECT requests and OPTIONS * requests do not have URLs
This commit is contained in:
1 parent
74191f0834
commit
40ca463b5f
2 files changed
+30
No files matched your search
@@ -24,6 +24,11 @@ extension HTTPRequest {
|
||||
/// fields.
|
||||
public var url: URL? {
|
||||
get {
|
||||
if (self.method == .connect && self.extendedConnectProtocol == nil)
|
||||
|| (self.method == .options && self.path == "*")
|
||||
{
|
||||
return nil
|
||||
}
|
||||
if let schemeField = self.pseudoHeaderFields.scheme,
|
||||
let authorityField = self.pseudoHeaderFields.authority,
|
||||
let pathField = self.pseudoHeaderFields.path
|
||||
|
||||
Reference in new issue
Block a user