From f378e685f9191718c0d64ff092e9deeb02561761 Mon Sep 17 00:00:00 2001
From: Raine <raine@ixvd.net>
Date: Sat, 14 Oct 2023 22:39:17 +0200
Subject: [PATCH] fix: responder impl

---
 Cargo.lock             |  2 +-
 Cargo.toml             |  2 +-
 src/dom/element/mod.rs | 13 +++++++------
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 7632e16..c2944c1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -634,7 +634,7 @@ checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
 
 [[package]]
 name = "milly"
-version = "0.1.0"
+version = "0.1.2"
 dependencies = [
  "actix-web",
 ]
diff --git a/Cargo.toml b/Cargo.toml
index 77b46c2..4486667 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "milly"
-version = "0.1.2"
+version = "0.1.3"
 edition = "2021"
 
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/src/dom/element/mod.rs b/src/dom/element/mod.rs
index a178cfc..8e036dc 100644
--- a/src/dom/element/mod.rs
+++ b/src/dom/element/mod.rs
@@ -95,15 +95,16 @@ impl Element {
 }
 
 #[cfg(feature = "actix")]
-use actix_web::{HttpRequest, HttpResponse, HttpResponseBuilder, Responder};
+use actix_web::{HttpRequest, HttpResponse, Responder, body::BoxBody, http::{StatusCode, header::ContentType}};
+
 #[cfg(feature = "actix")]
 impl Responder for Element {
-    type Body = String;
+    type Body = BoxBody;
 
-    fn respond_to(self, req: &HttpRequest) -> HttpResponse<Self::Body> {
-        HttpResponse::Ok()
-            .body(self.into())
-            .finish()
+    fn respond_to(self, _: &HttpRequest) -> HttpResponse<Self::Body> {
+        HttpResponse::build(StatusCode::OK)
+            .insert_header(ContentType::html())
+            .body(self.to_string())
     }
 }