fix url parse
Some checks failed
Docker Build and Push / build (push) Has been cancelled

This commit is contained in:
tsuki 2025-08-13 12:09:07 +08:00
parent f0269a05fe
commit cf492be360

View File

@ -121,7 +121,7 @@ async fn data_handler(
&state.config.local_oss, &state.config.local_oss,
&segments.collect::<Vec<&str>>(), &segments.collect::<Vec<&str>>(),
) { ) {
Ok(url) => url.replace(".png", "_processed.png"), Ok(url) => url,
Err(e) => { Err(e) => {
return ( return (
StatusCode::INTERNAL_SERVER_ERROR, StatusCode::INTERNAL_SERVER_ERROR,
@ -131,6 +131,7 @@ async fn data_handler(
} }
}; };
println!("url: {}", url);
match download_image(&url).await { match download_image(&url).await {
Ok((image_data, content_type)) => { Ok((image_data, content_type)) => {
// 缓存图像数据 // 缓存图像数据
@ -176,7 +177,7 @@ async fn data_handler(
async fn data_nearest_handler( async fn data_nearest_handler(
Query(params): Query<TileInfo>, Query(params): Query<TileInfo>,
State(mut state): State<AppState>, State(state): State<AppState>,
) -> impl IntoResponse { ) -> impl IntoResponse {
match chrono::NaiveDateTime::parse_from_str(&params.datetime, "%Y%m%d%H%M%S") { match chrono::NaiveDateTime::parse_from_str(&params.datetime, "%Y%m%d%H%M%S") {
Ok(naive_datetime) => { Ok(naive_datetime) => {