Skip to content

Commit

Permalink
style: use inline formatting in errors.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
miwig authored and antonengelhardt committed Nov 4, 2024
1 parent 0ee2e43 commit 3c23164
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub enum PluginError {
impl ConfiguredOidc {
pub fn show_error_page(&self, status_code: u32, title: &str, message: &str) {
let headers = vec![("cache-control", "no-cache"), ("content-type", "text/html")];
let request_id = self.request_id.clone().unwrap_or_default();

self.send_http_response(
status_code,
Expand All @@ -81,7 +82,7 @@ impl ConfiguredOidc {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Error - {}</title>
<title>Error - {status_code}</title>
<style>
:root {{
--bg-color: #f0f2f5;
Expand Down Expand Up @@ -194,10 +195,10 @@ impl ConfiguredOidc {
</label>
</div>
<div class="error-container">
<h1>Error {}</h1>
<h2>{}</h2>
<p>{}</p>
<p class="request-id">Request-ID: {}</p>
<h1>Error {status_code}</h1>
<h2>{title}</h2>
<p>{message}</p>
<p class="request-id">Request-ID: {request_id}</p>
</div>
<script>
const darkModeToggle = document.getElementById('darkModeToggle');
Expand Down Expand Up @@ -225,7 +226,6 @@ impl ConfiguredOidc {
</body>
</html>
"#,
status_code, status_code, title, message, self.request_id.clone().unwrap()
)
.as_bytes(),
),
Expand Down

0 comments on commit 3c23164

Please sign in to comment.