Skip to content

Commit

Permalink
Set charset=utf-8 for /raw/{id} response
Browse files Browse the repository at this point in the history
This matches `<meta charset="utf-8">` in HTML and thus lets browser
decode content properly.
  • Loading branch information
luk1337 committed Dec 23, 2023
1 parent b8a0c54 commit 70a666a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/endpoints/pasta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ pub async fn getrawpasta(

// send raw content of pasta
let response = Ok(HttpResponse::NotFound()
.content_type("text/plain")
.content_type("text/plain; charset=utf-8")
.body(pastas[index].content.to_owned()));

return response;
Expand Down

0 comments on commit 70a666a

Please sign in to comment.