about summary refs log tree commit diff stats
path: root/src/io/buffer.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-08-18 21:08:29 +0200
committerbptato <nincsnevem662@gmail.com>2022-08-18 21:08:29 +0200
commit6a990cef8eac9bf11d785d942873f9a5fa614585 (patch)
tree75315119c5787d89b1d0ee4512d445a19d18c068 /src/io/buffer.nim
parent7a4faea7e046a65b2feeea6b2e08254a15eaef4c (diff)
downloadchawan-6a990cef8eac9bf11d785d942873f9a5fa614585.tar.gz
Fix request error handling
Diffstat (limited to 'src/io/buffer.nim')
-rw-r--r--src/io/buffer.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim
index 13add309..bcbaef2d 100644
--- a/src/io/buffer.nim
+++ b/src/io/buffer.nim
@@ -846,14 +846,15 @@ proc loadResources(buffer: Buffer, document: Document) =
         if url.issome:
           let url = url.get
           if url.scheme == buffer.location.scheme:
-            let fs = buffer.loader.getPage(newRequest(url))
+            let fs = buffer.loader.doRequest(newRequest(url))
             if fs.s != nil and fs.contenttype == "text/css":
               var res = newStringStream()
               while true:
                 var s: string
-                buffer.istream.sread(s)
+                fs.s.sread(s)
                 if s == "": break
                 res.write(s)
+              res.setPosition(0)
               let sheet = parseStylesheet(res)
               elem.sheet = sheet