diff --git a/src/modes/server/api/item.rs b/src/modes/server/api/item.rs index f4c4124..5876e85 100644 --- a/src/modes/server/api/item.rs +++ b/src/modes/server/api/item.rs @@ -1,8 +1,7 @@ use axum::{ - extract::{Path, Query, State, Host}, - http::{StatusCode}, + extract::{Path, Query, State}, + http::{StatusCode, header}, response::{Json, Response}, - http::header, }; use log::{debug, warn}; use std::collections::HashMap; @@ -581,7 +580,6 @@ async fn stream_item_content_response_with_metadata( )] pub async fn handle_get_item_latest_meta( State(state): State, - Host(host): Host, Query(params): Query, ) -> Result>>, StatusCode> { let tags: Vec = params @@ -603,7 +601,7 @@ pub async fn handle_get_item_latest_meta( let mut item_meta = item_with_meta.meta_as_map(); // Add content_url to metadata if let Some(item_id) = item_with_meta.item.id { - item_meta.insert("content_url".to_string(), format!("http://{}/api/item/{}/content", host, item_id)); + item_meta.insert("content_url".to_string(), format!("/api/item/{}/content", item_id)); } let response = ApiResponse { @@ -645,7 +643,6 @@ pub async fn handle_get_item_latest_meta( )] pub async fn handle_get_item_meta( State(state): State, - Host(host): Host, Path(item_id): Path, ) -> Result>>, StatusCode> { let item_service = AsyncItemService::new( @@ -660,7 +657,7 @@ pub async fn handle_get_item_meta( Ok(item_with_meta) => { let mut item_meta = item_with_meta.meta_as_map(); // Add content_url to metadata - item_meta.insert("content_url".to_string(), format!("http://{}/api/item/{}/content", host, item_id)); + item_meta.insert("content_url".to_string(), format!("/api/item/{}/content", item_id)); let response = ApiResponse { success: true,