Skip to main content

feedparser_rs/http/
mod.rs

1/// HTTP client module for fetching feeds from URLs
2///
3/// This module provides HTTP fetching capabilities with support for:
4/// - Conditional GET (`ETag` and `Last-Modified` headers)
5/// - Automatic decompression (gzip, deflate, brotli)
6/// - Redirect following
7/// - Custom User-Agent and headers
8///
9/// # Examples
10///
11/// ```no_run
12/// use feedparser_rs::http::FeedHttpClient;
13///
14/// let client = FeedHttpClient::new().unwrap();
15/// let response = client.get(
16///     "https://example.com/feed.xml",
17///     None,  // no ETag
18///     None,  // no Last-Modified
19///     None,  // no extra headers
20/// ).unwrap();
21///
22/// if response.status == 200 {
23///     println!("Fetched {} bytes", response.body.len());
24/// }
25/// ```
26mod client;
27mod error;
28/// SSRF-safe DNS resolver, closing the DNS-rebinding gap for `FeedHttpClient`
29mod resolver;
30mod response;
31
32/// URL validation module for SSRF protection
33pub mod validation;
34
35pub use client::FeedHttpClient;
36pub use error::{FetchError, HeaderField, HttpStatus, TransportError, error_chain};
37pub use response::FeedHttpResponse;
38pub use validation::validate_url;