about summary refs log tree commit diff stats
path: root/src/server
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-14 01:52:16 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-14 01:53:10 +0100
commit5356de1a9e8e25c8a999c7a836727b59c565b28b (patch)
tree43ae3bd6b5cbc5604733264078e6cbe40729240d /src/server
parentf0aac2ccd2d0a5c5f734d464bb003df09ec9a19d (diff)
downloadchawan-5356de1a9e8e25c8a999c7a836727b59c565b28b.tar.gz
buffer: fix regression on htmloutput document baseURL
readFromFd replacing the base URL of the buffer turns out to be a very
bad idea.
Diffstat (limited to 'src/server')
-rw-r--r--src/server/buffer.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index d830029b..85d9cd45 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -87,6 +87,7 @@ type
   Buffer* = ref object
     rfd: int # file descriptor of command pipe
     fd: int # file descriptor of buffer source
+    url: URL # URL before readFromFd
     alive: bool
     lines: FlexibleGrid
     rendered: bool
@@ -274,9 +275,6 @@ macro task(fun: typed) =
   pfun.istask = true
   fun
 
-func url(buffer: Buffer): URL =
-  return buffer.source.request.url
-
 func charsets(buffer: Buffer): seq[Charset] =
   if buffer.source.charset != CHARSET_UNKNOWN:
     return @[buffer.source.charset]
@@ -1760,6 +1758,7 @@ proc launchBuffer*(config: BufferConfig, source: BufferSource,
     attrs: WindowAttributes, loader: FileLoader, ssock: ServerSocket) =
   let socks = ssock.acceptSocketStream()
   let buffer = Buffer(
+    url: source.request.url,
     alive: true,
     attrs: attrs,
     config: config,