Skip to content

Commit 8d8baf5

Browse files
authored
docs(iroh-dns-server): Fixup rate limit config docs (#2894)
## Description Cargo docs was complaining about the links being incorrect. Also the style guide was not being followed. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions Not sure how the incorrect links made it in. Also, when will we have a linter for the style guide... ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
1 parent 258eb33 commit 8d8baf5

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

iroh-dns-server/src/http/rate_limiting.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ use tower_governor::{
88
GovernorLayer,
99
};
1010

11-
/// Config for http rate limit.
11+
/// Config for http server rate limit.
1212
#[derive(Debug, Deserialize, Default, Serialize, Clone)]
1313
#[serde(rename_all = "lowercase")]
1414
pub enum RateLimitConfig {
15-
/// Disable rate limit for http server.
15+
/// Disable rate limit.
1616
Disabled,
17-
/// Enable rate limit for http server based on the connection peer IP address.
18-
/// https://docs.rs/tower_governor/latest/tower_governor/key_extractor/struct.PeerIpKeyExtractor.html
17+
/// Enable rate limit based on the connection's peer IP address.
18+
///
19+
/// <https://docs.rs/tower_governor/latest/tower_governor/key_extractor/struct.PeerIpKeyExtractor.html>
1920
#[default]
2021
Simple,
21-
/// Enable rate limit for http server based on a smart logic for extracting the connection original IP address, useful for reverse proxies.
22-
/// https://docs.rs/tower_governor/latest/tower_governor/key_extractor/struct.SmartIpKeyExtractor.html
22+
/// Enable rate limit based on headers commonly used by reverse proxies.
23+
///
24+
/// Uses headers commonly used by reverse proxies to extract the original IP address,
25+
/// falling back to the connection's peer IP address.
26+
/// <https://docs.rs/tower_governor/latest/tower_governor/key_extractor/struct.SmartIpKeyExtractor.html>
2327
Smart,
2428
}
2529

0 commit comments

Comments
 (0)