Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Sources/NIOHTTP1/HTTPTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ let headerSeparator: StaticString = ": "
/// A representation of the request line and header fields of a HTTP request.
public struct HTTPRequestHead: Equatable {
/// The HTTP method for this request.
public let method: HTTPMethod
public var method: HTTPMethod

// Internal representation of the URI.
private let rawURI: URI
private var rawURI: URI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is private so I think this makes no sense or I am missing something ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that one could stay let.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed adding a set case to uri, that is added now (and relies on rawURI being mutable)


/// The URI used on this request.
public var uri: String {
return String(uri: rawURI)
get {
return String(uri: rawURI)
}
set {
rawURI = .string(newValue)
}
}

/// The version for this HTTP request.
public let version: HTTPVersion
public var version: HTTPVersion

/// The header fields for this HTTP request.
public var headers: HTTPHeaders
Expand Down Expand Up @@ -138,10 +143,10 @@ extension HTTPRequestHead {
/// A representation of the status line and header fields of a HTTP response.
public struct HTTPResponseHead: Equatable {
/// The HTTP response status.
public let status: HTTPResponseStatus
public var status: HTTPResponseStatus

/// The HTTP version that corresponds to this response.
public let version: HTTPVersion
public var version: HTTPVersion

/// The HTTP headers on this response.
public var headers: HTTPHeaders
Expand Down