Skip to content

Commit 72bd077

Browse files
authored
fix: allow http for proxy (#400)
<!-- Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. --> Allows HTTP when using `--proxy`.
1 parent 54bacc0 commit 72bd077

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/addon/proxy.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
use std::str::FromStr;
2+
use std::sync::Arc;
3+
14
use http::header::USER_AGENT;
25
use http::header::{HeaderName, HeaderValue};
36
use hyper::client::HttpConnector;
47
use hyper::{Body, Client, Response, Uri};
58
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
6-
use std::str::FromStr;
7-
use std::sync::Arc;
89

910
use crate::server::middleware::Request;
1011

@@ -17,7 +18,7 @@ impl Proxy {
1718
pub fn new(upstream: &str) -> Self {
1819
let https_connector = HttpsConnectorBuilder::new()
1920
.with_webpki_roots()
20-
.https_only()
21+
.https_or_http()
2122
.enable_http1()
2223
.build();
2324
let client = Client::builder().build::<_, hyper::Body>(https_connector);

0 commit comments

Comments
 (0)