Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
allow https scheme for loading dump (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma authored Sep 25, 2023
1 parent 15c333d commit fef7293
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sqld/src/http/admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use axum::routing::delete;
use axum::Json;
use chrono::NaiveDateTime;
use futures::TryStreamExt;
use hyper::Body;
use serde::Deserialize;
use std::io::ErrorKind;
use std::sync::Arc;
Expand Down Expand Up @@ -134,8 +135,13 @@ async fn handle_fork_namespace<M: MakeNamespace>(

async fn dump_stream_from_url(url: &Url) -> Result<DumpStream, LoadDumpError> {
match url.scheme() {
"http" => {
let client = hyper::client::Client::new();
"http" | "https" => {
let connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.https_or_http()
.enable_http1()
.build();
let client = hyper::client::Client::builder().build::<_, Body>(connector);
let uri = url
.as_str()
.parse()
Expand Down

0 comments on commit fef7293

Please sign in to comment.