Skip to content

Commit f6ae022

Browse files
committed
Better docs
1 parent da93f88 commit f6ae022

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Sources/AsyncHTTPClient/HTTPClient.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,19 +1278,21 @@ extension HTTPClient.Configuration {
12781278
public var max: Int
12791279
/// Whether cycles are allowed.
12801280
public var allowCycles: Bool
1281-
/// Whether to retain the HTTP method and body when following a 301 redirect.
1281+
/// Whether to retain the HTTP method and body when following a 301 redirect on a POST request.
12821282
/// This should be false as per the fetch spec, but may be true according to RFC 9110.
1283+
/// This does not affect non-POST requests.
12831284
public var retainHTTPMethodAndBodyOn301: Bool
1284-
/// Whether to retain the HTTP method and body when following a 302 redirect.
1285+
/// Whether to retain the HTTP method and body when following a 302 redirect on a POST request.
12851286
/// This should be false as per the fetch spec, but may be true according to RFC 9110.
1287+
/// This does not affect non-POST requests.
12861288
public var retainHTTPMethodAndBodyOn302: Bool
12871289

12881290
/// Create a new ``FollowConfiguration``
12891291
/// - Parameters:
12901292
/// - max: The maximum number of allowed redirects.
12911293
/// - allowCycles: Whether cycles are allowed.
1292-
/// - retainHTTPMethodAndBodyOn301: Whether to retain the HTTP method and body when following a 301 redirect. This should be false as per the fetch spec, but may be true according to RFC 9110.
1293-
/// - retainHTTPMethodAndBodyOn302: Whether to retain the HTTP method and body when following a 302 redirect. This should be false as per the fetch spec, but may be true according to RFC 9110.
1294+
/// - retainHTTPMethodAndBodyOn301: Whether to retain the HTTP method and body when following a 301 redirect on a POST request. This should be false as per the fetch spec, but may be true according to RFC 9110. This does not affect non-POST requests.
1295+
/// - retainHTTPMethodAndBodyOn302: Whether to retain the HTTP method and body when following a 302 redirect on a POST request. This should be false as per the fetch spec, but may be true according to RFC 9110. This does not affect non-POST requests.
12941296
public init(
12951297
max: Int,
12961298
allowCycles: Bool,

Sources/AsyncHTTPClient/HTTPClientConfiguration+SwiftConfiguration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ extension HTTPClient.Configuration.RedirectConfiguration {
6666
/// - `mode` (string, optional, default: "follow"): Redirect handling mode ("follow" or "disallow").
6767
/// - `maxRedirects` (int, optional, default: 5): Maximum allowed redirects when mode is "follow".
6868
/// - `allowCycles` (bool, optional, default: false): Allow cyclic redirects when mode is "follow".
69-
/// - `retainHTTPMethodAndBodyOn301` (bool, optional, default: false): Retain the original HTTP method and body on 301 redirect when mode is "follow". This is contrary to the fetch specification, but is allowed by RFC 9110.
70-
/// - `retainHTTPMethodAndBodyOn302` (bool, optional, default: false): Retain the original HTTP method and body on 302 redirect when mode is "follow". This is contrary to the fetch specification, but is allowed by RFC 9110.
69+
/// - `retainHTTPMethodAndBodyOn301` (bool, optional, default: false): Whether to retain the HTTP method and body when following a 301 redirect on a POST request. This should be false as per the fetch spec, but may be true according to RFC 9110. This does not affect non-POST requests.
70+
/// - `retainHTTPMethodAndBodyOn302` (bool, optional, default: false): Whether to retain the HTTP method and body when following a 302 redirect on a POST request. This should be false as per the fetch spec, but may be true according to RFC 9110. This does not affect non-POST requests.
7171
///
7272
/// - Throws: `HTTPClientError.invalidRedirectConfiguration` if mode is specified but invalid.
7373
public init(configReader: ConfigReader) throws {

0 commit comments

Comments
 (0)