Skip to content

Commit

Permalink
fix: oss will not use the port (apache#4899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzzzzzt committed Jul 16, 2024
1 parent f872ac3 commit 1a14b0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/services/oss/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ impl OssBuilder {
.with_context("service", Scheme::Oss)
.with_context("endpoint", &ep)
})?;
let full_host = format!("{bucket}.{host}");
let full_host = if let Some(port) = uri.port_u16() {
format!("{bucket}.{host}:{port}")
} else {
format!("{bucket}.{host}")
};
let endpoint = match uri.scheme_str() {
Some(scheme_str) => match scheme_str {
"http" | "https" => format!("{scheme_str}://{full_host}"),
Expand Down

0 comments on commit 1a14b0b

Please sign in to comment.