about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-15 02:31:39 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-15 02:32:08 +0100
commit2b56e59510ffe7f118702272fea46ea2a72aa3af (patch)
tree6b3932913d5df6425d88f42655bce098cabb9a15 /src
parentde2a1e6b245f573772d2c69d403271db8ceae2fe (diff)
downloadchawan-2b56e59510ffe7f118702272fea46ea2a72aa3af.tar.gz
Set ishtml in the correct place, take ishtml on clone
Diffstat (limited to 'src')
-rw-r--r--src/local/container.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/local/container.nim b/src/local/container.nim
index 8874c2d0..a82f7aaf 100644
--- a/src/local/container.nim
+++ b/src/local/container.nim
@@ -192,6 +192,7 @@ proc clone*(container: Container, newurl: URL): Promise[Container] =
       redirectdepth: container.redirectdepth,
       select: container.select,
       canreinterpret: container.canreinterpret,
+      ishtml: container.ishtml,
       cloned: true
     )
     if newurl != nil:
@@ -1196,12 +1197,12 @@ proc load(container: Container) =
         if res.redirect != nil:
           container.triggerEvent(ContainerEvent(t: REDIRECT, request: res.redirect))
         container.source.charset = res.charset
+        container.ishtml = res.contentType == "text/html"
         if res.contentType == "application/octet-stream":
           let contentType = guessContentType(container.location.pathname,
             "application/octet-stream", container.config.mimeTypes)
           if contentType != "application/octet-stream":
             container.iface.setContentType(contentType)
-            container.ishtml = contentType == "text/html"
           container.source.contentType = some(contentType)
         else:
           container.source.contentType = some(res.contentType)