1
0
mirror of https://github.com/actix/examples synced 2025-06-27 01:27:43 +02:00

Bump the aws group with 1 update (#653)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
dependabot[bot]
2023-11-20 18:54:13 +00:00
committed by GitHub
parent f967173aee
commit 1b43dde946
4 changed files with 54 additions and 50 deletions

View File

@ -44,7 +44,7 @@ impl Client {
Some((
object
.content_length()
.try_into()
.and_then(|len| len.try_into().ok())
.expect("file has invalid size"),
object.body,
))

View File

@ -6,7 +6,7 @@ use actix_web::{
HttpServer, Responder,
};
use actix_web_lab::{extract::Path, respond::Html};
use aws_config::meta::region::RegionProviderChain;
use aws_config::{meta::region::RegionProviderChain, BehaviorVersion};
use dotenvy::dotenv;
use serde_json::json;
@ -90,7 +90,10 @@ async fn main() -> std::io::Result<()> {
log::info!("configuring S3 client");
let aws_region = RegionProviderChain::default_provider().or_else("us-east-1");
let aws_config = aws_config::from_env().region(aws_region).load().await;
let aws_config = aws_config::defaults(BehaviorVersion::latest())
.region(aws_region)
.load()
.await;
// create singleton S3 client
let s3_client = Client::new(&aws_config);