Skip to content

Commit 072596c

Browse files
committed
Merge #459: Release tracking PR: bitreq v0.3.0
b9db614 [bitreq] Add a changelog entry for 0.3 (Matt Corallo) 51ffafd [bitreq] Bump crate version to 0.3 (Matt Corallo) bc4f41a [bitreq] Rename `Proxy::new` to `Proxy::new_http` (Matt Corallo) 99acf70 [bitreq] Drop mention port port 1080 which is for SOCKS, not HTTP (Matt Corallo) d69be71 [bitreq] Make `Error` `#[non_exhaustive]` (Matt Corallo) Pull request description: Based on #452 I think its reasonable to release a bitreq 0.3. There's some issues remaining in the proxy code described in #458 but those should be addressable in a point release without API breakage. ACKs for top commit: tcharding: ACK b9db614 Tree-SHA512: 36d4660f2f37104e9e9fa2ded578b9385b23eee966ecf59de630dfb05eddeb4f1421e656bd410666eabe5708b45771ba1aa3ee8d04cc83c142b017c0ce048208
2 parents 1eab670 + b9db614 commit 072596c

File tree

10 files changed

+27
-17
lines changed

10 files changed

+27
-17
lines changed

Cargo-minimal.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
141141

142142
[[package]]
143143
name = "bitreq"
144-
version = "0.2.0"
144+
version = "0.3.0"
145145
dependencies = [
146146
"base64 0.22.1",
147147
"log",

Cargo-recent.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
141141

142142
[[package]]
143143
name = "bitreq"
144-
version = "0.2.0"
144+
version = "0.3.0"
145145
dependencies = [
146146
"base64 0.22.1",
147147
"log",

bitreq/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 0.3.0 - 2026-01-16
2+
3+
* Fix a denial-of-service issue due to lack of bounding in response size [#452](https://github.com/rust-bitcoin/corepc/pull/452)
4+
* Add support for `native-tls` in addition to `rustls` [#451](https://github.com/rust-bitcoin/corepc/pull/451)
5+
* Support connection reuse via a `Client` object [#450](https://github.com/rust-bitcoin/corepc/pull/450)
6+
* Make `async` native async rather than spawning a blocking task [#448](https://github.com/rust-bitcoin/corepc/pull/448)
7+
* Remove `urlencoding` dependence [#424](https://github.com/rust-bitcoin/corepc/pull/424)
8+
* Remove `punycode` dependency [#423](https://github.com/rust-bitcoin/corepc/pull/423)
9+
* Remove unused `tokio` features [#421](https://github.com/rust-bitcoin/corepc/pull/421)
10+
111
# 0.2.0 - 2025-10-31
212

313
* Re-implement `json-using-serde` feature [#398](https://github.com/rust-bitcoin/corepc/pull/398)

bitreq/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitreq"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
authors = ["Jens Pitkanen <jens@neon.moe>", "Tobin C. Harding <me@tobin.cc>"]
55
description = "Simple, minimal-dependency HTTP client"
66
documentation = "https://docs.rs/bitreq"

bitreq/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{error, io};
44

55
/// Represents an error while sending, receiving, or parsing an HTTP response.
66
#[derive(Debug)]
7-
// TODO: Make non-exhaustive for 3.0?
7+
#[non_exhaustive]
88
// TODO: Maybe make a few inner error types containing groups of these, based on
99
// what the user might want to handle? This error doesn't really invite graceful
1010
// handling.
@@ -60,7 +60,7 @@ pub enum Error {
6060
/// and as such, a connection cannot be made.
6161
HttpsFeatureNotEnabled,
6262
/// The provided proxy information was not properly formatted. See
63-
/// [Proxy::new](crate::Proxy::new) for the valid format.
63+
/// [Proxy](crate::Proxy) methods for the valid format.
6464
#[cfg(feature = "proxy")]
6565
BadProxy,
6666
/// The provided credentials were rejected by the proxy server.

bitreq/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
208208
//! #[cfg(feature = "proxy")]
209209
//! {
210-
//! let proxy = bitreq::Proxy::new("localhost:8080")?;
210+
//! let proxy = bitreq::Proxy::new_http("localhost:8080")?;
211211
//! let response = bitreq::post("http://example.com")
212212
//! .with_proxy(proxy)
213213
//! .send()?;

bitreq/src/proxy.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ impl Proxy {
4141
}
4242
}
4343

44-
/// Creates a new Proxy configuration.
44+
/// Creates a new Proxy configuration for an HTTP proxy supporting the `CONNECT` command.
4545
///
4646
/// Supported proxy format is:
4747
///
4848
/// ```plaintext
4949
/// [http://][user[:password]@]host[:port]
5050
/// ```
5151
///
52-
/// The default port is 8080, to be changed to 1080 in bitreq 3.0.
52+
/// The default port is 8080.
5353
///
5454
/// # Example
5555
///
5656
/// ```
57-
/// let proxy = bitreq::Proxy::new("user:password@localhost:1080").unwrap();
57+
/// let proxy = bitreq::Proxy::new_http("user:password@localhost:1080").unwrap();
5858
/// let request = bitreq::post("http://example.com").with_proxy(proxy);
5959
/// ```
6060
///
61-
pub fn new<S: AsRef<str>>(proxy: S) -> Result<Self, Error> {
61+
pub fn new_http<S: AsRef<str>>(proxy: S) -> Result<Self, Error> {
6262
let proxy = proxy.as_ref();
6363
let authority = if let Some((proto, auth)) = split_once(proxy, "://") {
6464
if proto != "http" {
@@ -141,7 +141,7 @@ mod tests {
141141

142142
#[test]
143143
fn parse_proxy() {
144-
let proxy = Proxy::new("user:p@ssw0rd@localhost:9999").unwrap();
144+
let proxy = Proxy::new_http("user:p@ssw0rd@localhost:9999").unwrap();
145145
assert_eq!(proxy.user, Some(String::from("user")));
146146
assert_eq!(proxy.password, Some(String::from("p@ssw0rd")));
147147
assert_eq!(proxy.server, String::from("localhost"));
@@ -150,7 +150,7 @@ mod tests {
150150

151151
#[test]
152152
fn parse_regular_proxy_with_protocol() {
153-
let proxy = Proxy::new("http://localhost:1080").unwrap();
153+
let proxy = Proxy::new_http("http://localhost:1080").unwrap();
154154
assert_eq!(proxy.user, None);
155155
assert_eq!(proxy.password, None);
156156
assert_eq!(proxy.server, String::from("localhost"));

bitreq/src/request.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,22 +393,22 @@ impl ParsedRequest {
393393
if let Ok(proxy) =
394394
std::env::var("https_proxy").map_err(|_| std::env::var("HTTPS_PROXY"))
395395
{
396-
if let Ok(proxy) = Proxy::new(proxy) {
396+
if let Ok(proxy) = Proxy::new_http(proxy) {
397397
config.proxy = Some(proxy);
398398
}
399399
}
400400
}
401401
// Set HTTP proxies if request's protocol is HTTP and they're given
402402
else if let Ok(proxy) = std::env::var("http_proxy") {
403-
if let Ok(proxy) = Proxy::new(proxy) {
403+
if let Ok(proxy) = Proxy::new_http(proxy) {
404404
config.proxy = Some(proxy);
405405
}
406406
}
407407
// Set any given proxies if neither of HTTP/HTTPS were given
408408
else if let Ok(proxy) =
409409
std::env::var("all_proxy").map_err(|_| std::env::var("ALL_PROXY"))
410410
{
411-
if let Ok(proxy) = Proxy::new(proxy) {
411+
if let Ok(proxy) = Proxy::new_http(proxy) {
412412
config.proxy = Some(proxy);
413413
}
414414
}

jsonrpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ serde = { version = "1", features = ["derive"] }
3434
serde_json = { version = "1", features = [ "raw_value" ] }
3535

3636
base64 = { version = "0.22.1", optional = true }
37-
bitreq = { version = "0.2.0", path = "../bitreq", features = ["json-using-serde"], optional = true }
37+
bitreq = { version = "0.3.0", path = "../bitreq", features = ["json-using-serde"], optional = true }
3838
socks = { version = "0.3.4", optional = true}
3939

4040
[lints.rust]

node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env_logger = { version = "0.9.3", default-features = false }
2727
anyhow = { version = "1.0.66", optional = true }
2828
bitcoin_hashes = { version = ">= 0.13, <= 0.14", optional = true }
2929
flate2 = { version = "1.0", optional = true }
30-
bitreq = { version = "0.2.0", path = "../bitreq", features = ["https"], optional = true }
30+
bitreq = { version = "0.3.0", path = "../bitreq", features = ["https"], optional = true }
3131
tar = { version = "0.4", optional = true }
3232
zip = { version = "0.6.6", default-features = false, features = ["bzip2", "deflate"], optional = true }
3333

0 commit comments

Comments
 (0)