From 74bfc7ed9e2c7bfbcf244d123a68f74cb7f95131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=A2=A7=E8=97=A4?= <67498817+phidiaLam@users.noreply.github.com> Date: Tue, 11 Jun 2024 01:17:00 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=85=BE=E8=AE=AF=E4=BA=91=E8=B7=AF=E7=94=B1=E6=8B=BC=E6=8E=A5?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/bakery_logic/src/view.rs | 2 +- .../src/cdn/purge_urls_cache.rs | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/logic/bakery_logic/src/view.rs b/logic/bakery_logic/src/view.rs index a1ea330d..f07be2cd 100644 --- a/logic/bakery_logic/src/view.rs +++ b/logic/bakery_logic/src/view.rs @@ -170,7 +170,7 @@ impl BakeryTcCdnPath { } PurgeCachePath::new_with_query( - "/cdn/bakery/mansionInfo", + "/canteen/bakery/mansionInfo", &MansionId { mansion_id: mid }, ) } diff --git a/middle-server/tencent-cloud-server/src/cdn/purge_urls_cache.rs b/middle-server/tencent-cloud-server/src/cdn/purge_urls_cache.rs index 7f916ad7..c4a5e4b3 100644 --- a/middle-server/tencent-cloud-server/src/cdn/purge_urls_cache.rs +++ b/middle-server/tencent-cloud-server/src/cdn/purge_urls_cache.rs @@ -1,6 +1,5 @@ use general_request_client::Url; use serde::Serialize; -use url::Position; use super::{SERVICE, VERSION}; use crate::{ @@ -46,8 +45,7 @@ impl TcCloudManager { .into_iter() .map(|PurgeCachePath { path, query }| { let mut url = Url::clone(&*self.cdn_base_url); - let prefix = &url[Position::BeforePath..]; - url.set_path(&(prefix.to_string() + path)); + url.set_path(path); url.set_query(query.as_deref()); url }) @@ -74,7 +72,6 @@ mod test { use mime::Mime; use serde::Serialize; use typed_builder::TypedBuilder; - use url::{Position, Url}; #[derive(Debug, Clone, TypedBuilder)] pub struct RequestContent { @@ -97,13 +94,4 @@ mod test { println!("{}", canonical_query); } - - #[test] - fn test_url() { - let mut url = Url::parse("http://server-cdn-dev.ceobecanteen.top/api/v1").unwrap(); - - let prefix = &url[Position::BeforePath..]; - url.set_path(&(prefix.to_string() + "/test/test")); - println!("{}", url) - } }