diff options
author | bptato <nincsnevem662@gmail.com> | 2022-01-25 18:33:59 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-01-25 18:33:59 +0100 |
commit | 51d09498f2377804b65c167b49a5efb2703abe89 (patch) | |
tree | c06aac7b1fa248d72b12c48ff689be99e4cd6d32 /src | |
parent | dfe56d32a0664026db3f2c3d8e018670daaf66c1 (diff) | |
download | chawan-51d09498f2377804b65c167b49a5efb2703abe89.tar.gz |
Disallow different scheme in link tags
Diffstat (limited to 'src')
-rw-r--r-- | src/io/buffer.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/io/buffer.nim b/src/io/buffer.nim index 4020c2f2..370e8209 100644 --- a/src/io/buffer.nim +++ b/src/io/buffer.nim @@ -720,10 +720,11 @@ proc loadResources(buffer: Buffer, document: Document) = if elem.rel == "stylesheet": let url = parseUrl(elem.href, document.location.some) if url.issome: - let res = buffer.loader.getPage(url.get) - if res.s != nil and res.contenttype == "text/css": - let sheet = parseStylesheet(res.s.readAll()) - elem.parentElement.sheets.add(sheet) + if url.get.scheme == buffer.location.scheme: + let res = buffer.loader.getPage(url.get) + if res.s != nil and res.contenttype == "text/css": + let sheet = parseStylesheet(res.s.readAll()) + elem.parentElement.sheets.add(sheet) for i in countdown(elem.children.high, 0): let child = elem.children[i] |