From 6a990cef8eac9bf11d785d942873f9a5fa614585 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 18 Aug 2022 21:08:29 +0200 Subject: Fix request error handling --- src/io/buffer.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/io/buffer.nim') 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 -- cgit 1.4.1-2-gfad0