Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
62edd49
Add a temporary IP filter
jan-auer Jan 11, 2021
d0ff004
Merge branch 'master' into restricted-connector
Swatinem Sep 22, 2022
2236850
Merge branch 'master' into restricted-connector
Swatinem Nov 10, 2022
04ea4c7
Merge branch 'master' into restricted-connector
Swatinem Aug 11, 2023
b55bcef
Merge branch 'master' into restricted-connector
Swatinem Nov 27, 2023
a780c82
properly restrict redirect URLs
Swatinem Nov 27, 2023
4a6d728
fix: Restrict redirects to http and https
jan-auer Dec 15, 2023
83e0eea
Merge branch 'master' into restricted-connector
Swatinem Feb 16, 2024
7331a73
Merge branch 'master' into restricted-connector
Swatinem Apr 2, 2024
81d75a6
telemetry: log dns timing 1% of time
JoshFerge Feb 19, 2025
6b25834
cargo fmt
JoshFerge Feb 19, 2025
ba7a942
more formatting
JoshFerge Feb 19, 2025
7408a31
change to info log
JoshFerge Feb 19, 2025
df9d761
try upping dns cache size
JoshFerge Feb 19, 2025
012bc30
500k dns entries cache
JoshFerge Feb 19, 2025
2b33e5b
tidy up build and warnings. default to hickory-dns
wedamija Mar 6, 2025
e3a440d
feat(dns): Allow dns servers to be specified when using hickory-dns
wedamija Mar 7, 2025
be34e1e
tidy up
wedamija Mar 7, 2025
736b8ca
feat(uptime): expose stats for uptime metrics (#3)
klochek Jun 16, 2025
4e2eff1
feat(uptime): add start timestamps and redirect uris to stats (#4)
klochek Jul 22, 2025
847e4f4
fix(uptime): stats fixes, plus corrections to redirect stats (#5)
klochek Jul 25, 2025
220c544
feat(uptime): record certificate bytes in redirect stats (#6)
klochek Aug 6, 2025
4e4b644
chore(uptime): bump hyper deps (#7)
klochek Aug 13, 2025
8bd14b0
chore(uptime): Capture DNS logs in more cases, and include resolved i…
Nov 13, 2025
a4846d1
feat(uptime): Add hashmap-based stats (#8)
klochek Dec 8, 2025
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
123 changes: 96 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,25 @@ rustdoc-args = ["--cfg", "docsrs", "--cfg", "reqwest_unstable"]
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]

[package.metadata.playground]
features = [
"blocking",
"cookies",
"json",
"multipart",
]
features = ["blocking", "cookies", "json", "multipart"]

[features]
default = ["default-tls", "charset", "http2", "macos-system-configuration"]
default = [
"default-tls",
"charset",
"http2",
"macos-system-configuration",
"hickory-dns",
]

# Note: this doesn't enable the 'native-tls' feature, which adds specific
# functionality for it.
default-tls = ["dep:hyper-tls", "dep:native-tls-crate", "__tls", "dep:tokio-native-tls"]
default-tls = [
"dep:hyper-tls",
"dep:native-tls-crate",
"__tls",
"dep:tokio-native-tls",
]

http2 = ["h2", "hyper/http2", "hyper-util/http2"]

Expand All @@ -45,15 +51,25 @@ rustls-tls-manual-roots = ["__rustls"]
rustls-tls-webpki-roots = ["dep:webpki-roots", "__rustls"]
rustls-tls-native-roots = ["dep:rustls-native-certs", "__rustls"]

blocking = ["futures-channel/sink", "futures-util/io", "futures-util/sink", "tokio/rt-multi-thread", "tokio/sync"]
blocking = [
"futures-channel/sink",
"futures-util/io",
"futures-util/sink",
"tokio/rt-multi-thread",
"tokio/sync",
]

charset = ["dep:encoding_rs"]

cookies = ["dep:cookie_crate", "dep:cookie_store"]

gzip = ["dep:async-compression", "async-compression?/gzip", "dep:tokio-util"]

brotli = ["dep:async-compression", "async-compression?/brotli", "dep:tokio-util"]
brotli = [
"dep:async-compression",
"async-compression?/brotli",
"dep:tokio-util",
]

deflate = ["dep:async-compression", "async-compression?/zlib", "dep:tokio-util"]

Expand All @@ -74,7 +90,13 @@ macos-system-configuration = ["dep:system-configuration"]

# Experimental HTTP/3 client.
# Disabled while waiting for quinn to upgrade.
#http3 = ["rustls-tls-manual-roots", "dep:h3", "dep:h3-quinn", "dep:quinn", "dep:futures-channel"]
http3 = [
"rustls-tls-manual-roots",
"dep:h3",
"dep:h3-quinn",
"dep:quinn",
"dep:futures-channel",
]

# Internal (PRIVATE!) features used to aid testing.
# Don't rely on these whatsoever. They may disappear at anytime.
Expand All @@ -84,7 +106,14 @@ __tls = ["dep:rustls-pemfile", "tokio/io-util"]

# Enables common rustls code.
# Equivalent to rustls-tls-manual-roots but shorter :)
__rustls = ["dep:hyper-rustls", "dep:tokio-rustls", "dep:rustls", "__tls", "dep:rustls-pemfile", "rustls-pki-types"]
__rustls = [
"dep:hyper-rustls",
"dep:tokio-rustls",
"dep:rustls",
"__tls",
"dep:rustls-pemfile",
"rustls-pki-types",
]

# When enabled, disable using the cached SYS_PROXIES.
__internal_proxy_sys_no_cache = []
Expand All @@ -100,7 +129,7 @@ tower-service = "0.3"
futures-core = { version = "0.3.0", default-features = false }
futures-util = { version = "0.3.0", default-features = false }
sync_wrapper = "0.1.2"

rand = "0.8"
# Optional deps...

## json
Expand All @@ -112,29 +141,40 @@ mime_guess = { version = "2.0", default-features = false, optional = true }
encoding_rs = { version = "0.8", optional = true }
http-body = "1"
http-body-util = "0.1"
hyper = { version = "1", features = ["http1", "client"] }
hyper-util = { version = "0.1.3", features = ["http1", "client", "client-legacy", "tokio"] }
hyper = { git = "https://github.com/getsentry/hyper", rev = "9efa5aedce8a36e9a86115b8c104da44fcc43d7e", features = [
"http1",
"client",
] }
hyper-util = { git = "https://github.com/getsentry/hyper-util", rev = "cff84af9d682add40b92c5a57ad43f73bb714081", features = [
"http1",
"client",
"client-legacy",
"tokio",
] }
h2 = { version = "0.4", optional = true }
once_cell = "1"
log = "0.4"
mime = "0.3.16"
percent-encoding = "2.1"
tokio = { version = "1.0", default-features = false, features = ["net", "time"] }
tokio = { version = "1.0", default-features = false, features = [
"net",
"time",
] }
pin-project-lite = "0.2.0"
ipnet = "2.3"

# Optional deps...
rustls-pemfile = { version = "2", optional = true }

## default-tls
hyper-tls = { version = "0.6", optional = true }
hyper-tls = { git = "https://github.com/getsentry/hyper-tls", rev = "7968d40a8b00842803adae4f65963bbf0b126dca", optional = true }
native-tls-crate = { version = "0.2.10", optional = true, package = "native-tls" }
tokio-native-tls = { version = "0.3.0", optional = true }

# rustls-tls
hyper-rustls = { version = "0.26.0", default-features = false, optional = true }
rustls = { version = "0.22.2", optional = true }
rustls-pki-types = { version = "1.1.0", features = ["alloc"] ,optional = true }
rustls-pki-types = { version = "1.1.0", features = ["alloc"], optional = true }
tokio-rustls = { version = "0.25", optional = true }
webpki-roots = { version = "0.26.0", optional = true }
rustls-native-certs = { version = "0.7", optional = true }
Expand All @@ -144,32 +184,61 @@ cookie_crate = { version = "0.17.0", package = "cookie", optional = true }
cookie_store = { version = "0.20.0", optional = true }

## compression
async-compression = { version = "0.4.0", default-features = false, features = ["tokio"], optional = true }
tokio-util = { version = "0.7.1", default-features = false, features = ["codec", "io"], optional = true }
async-compression = { version = "0.4.0", default-features = false, features = [
"tokio",
], optional = true }
tokio-util = { version = "0.7.1", default-features = false, features = [
"codec",
"io",
], optional = true }

## socks
tokio-socks = { version = "0.5.1", optional = true }

## hickory-dns
hickory-resolver = { version = "0.24", optional = true, features = ["tokio-runtime"] }
hickory-resolver = { version = "0.24", optional = true, features = [
"tokio-runtime",
] }

# HTTP/3 experimental support
h3 = { version = "0.0.4", optional = true }
h3-quinn = { version = "0.0.5", optional = true }
quinn = { version = "0.10", default-features = false, features = ["tls-rustls", "ring", "runtime-tokio"], optional = true }
quinn = { version = "0.10", default-features = false, features = [
"tls-rustls",
"ring",
"runtime-tokio",
], optional = true }
futures-channel = { version = "0.3", optional = true }


[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
env_logger = "0.10"
hyper = { version = "1.1.0", default-features = false, features = ["http1", "http2", "client", "server"] }
hyper-util = { version = "0.1", features = ["http1", "http2", "client", "client-legacy", "server-auto", "tokio"] }
hyper = { git = "https://github.com/getsentry/hyper", rev = "9efa5aedce8a36e9a86115b8c104da44fcc43d7e", default-features = false, features = [
"http1",
"http2",
"client",
"server",
] }
hyper-util = { git = "https://github.com/getsentry/hyper-util", rev = "cff84af9d682add40b92c5a57ad43f73bb714081", features = [
"http1",
"http2",
"client",
"client-legacy",
"server-auto",
"tokio",
] }
serde = { version = "1.0", features = ["derive"] }
libflate = "1.0"
brotli_crate = { package = "brotli", version = "3.3.0" }
doc-comment = "0.3"
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread"] }
futures-util = { version = "0.3.0", default-features = false, features = ["std", "alloc"] }
tokio = { version = "1.0", default-features = false, features = [
"macros",
"rt-multi-thread",
] }
futures-util = { version = "0.3.0", default-features = false, features = [
"std",
"alloc",
] }

[target.'cfg(windows)'.dependencies]
winreg = "0.52.0"
Expand Down Expand Up @@ -203,7 +272,7 @@ features = [
"ServiceWorkerGlobalScope",
"RequestCredentials",
"File",
"ReadableStream"
"ReadableStream",
]

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
Expand Down
7 changes: 3 additions & 4 deletions src/async_impl/body.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use bytes::Bytes;
use http_body::Body as HttpBody;
use http_body_util::combinators::BoxBody;
use std::fmt;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};

use bytes::Bytes;
use http_body::Body as HttpBody;
use http_body_util::combinators::BoxBody;
//use sync_wrapper::SyncWrapper;
#[cfg(feature = "stream")]
use tokio::fs::File;
Expand Down
Loading