Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sunli829 committed Jan 5, 2024
1 parent e8cdf5c commit 21c7176
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions examples/poem/acme-expanded-http-01/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ async fn main() -> Result<(), std::io::Error> {
}
tracing_subscriber::fmt::init();

let mut acme_client =
AcmeClient::try_new(&LETS_ENCRYPT_PRODUCTION.parse().unwrap(), vec![]).await?;
let mut acme_client = AcmeClient::try_new(LETS_ENCRYPT_PRODUCTION, vec![]).await?;
let cert_resolver = Arc::new(ResolveServerCert::default());
let challenge = ChallengeType::Http01;
let keys_for_http_challenge = Http01TokensMap::new();
Expand Down
3 changes: 1 addition & 2 deletions examples/poem/opentelemetry-jaeger/src/server1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use opentelemetry_http::HeaderInjector;
use opentelemetry_sdk::{propagation::TraceContextPropagator, trace::Tracer};
use poem::{
get, handler,
http::Method,
listener::TcpListener,
middleware::{OpenTelemetryMetrics, OpenTelemetryTracing},
web::Data,
Expand Down Expand Up @@ -38,7 +37,7 @@ async fn index(tracer: Data<&Tracer>, body: String) -> String {

let req = {
let mut req = reqwest::Request::new(
Method::GET,
reqwest::Method::GET,
Url::from_str("http://localhost:3002/api2").unwrap(),
);
global::get_text_map_propagator(|propagator| {
Expand Down
2 changes: 1 addition & 1 deletion poem/src/listener/acme/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct AcmeClient {
impl AcmeClient {
/// Create a new client. `directory_url` is the url for the ACME provider. `contacts` is a list
/// of URLS (ex: `mailto:`) the ACME service can use to reach you if there's issues with your certificates.
pub(crate) async fn try_new(directory_url: &str, contacts: Vec<String>) -> IoResult<Self> {
pub async fn try_new(directory_url: &str, contacts: Vec<String>) -> IoResult<Self> {
let client = Client::new();
let directory = get_directory(&client, directory_url).await?;
Ok(Self {
Expand Down

0 comments on commit 21c7176

Please sign in to comment.