Skip to content

Commit b67ee57

Browse files
committed
fix(response): Always proxy images as raw bytes
1 parent b9b4834 commit b67ee57

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ opt-level = 3
2222

2323
[dependencies]
2424
# Gemini
25-
germ = { version = "0.4.6", features = ["ast", "meta"] }
25+
germ = { version = "0.4.7", features = ["ast", "meta"] }
2626

2727
# HTTP
2828
actix-web = "4.11.0"

src/response.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ pub async fn default(
9393

9494
timer = Instant::now();
9595

96+
if response.meta().starts_with("image/") {
97+
if let Some(content_bytes) = &response.content_bytes() {
98+
return Ok(
99+
HttpResponse::build(actix_web::http::StatusCode::OK)
100+
.content_type(response.meta().as_ref())
101+
.body(content_bytes.to_vec()),
102+
);
103+
}
104+
}
105+
96106
let mut html_context = if configuration.is_raw() {
97107
String::new()
98108
} else {

0 commit comments

Comments
 (0)