diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-01 19:52:49 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-01 20:02:22 +0100 |
commit | 5da4c6e629dd4a0647fd3fe06906445eea65b867 (patch) | |
tree | c116a41e32444512cd13e4c18327f65c8d868fad /src/buffer/container.nim | |
parent | 1a24350ee44859f6b3370ac15e8875a79fa7ae9b (diff) | |
download | chawan-5da4c6e629dd4a0647fd3fe06906445eea65b867.tar.gz |
loader: proper redirect handling
Diffstat (limited to 'src/buffer/container.nim')
-rw-r--r-- | src/buffer/container.nim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/buffer/container.nim b/src/buffer/container.nim index 2d2ff73e..a42422e5 100644 --- a/src/buffer/container.nim +++ b/src/buffer/container.nim @@ -46,12 +46,10 @@ type password*: bool of READ_AREA: tvalue*: string - of OPEN: + of OPEN, REDIRECT: request*: Request of ANCHOR, NO_ANCHOR: anchor*: string - of REDIRECT: - location*: URL of ALERT: msg*: string of UPDATE: @@ -685,8 +683,8 @@ proc load(container: Container) = container.setLoadInfo("Connected to " & $container.source.location & ". Downloading...") if res.needsAuth: container.triggerEvent(NEEDS_AUTH) - if res.redirect.isSome: - container.triggerEvent(ContainerEvent(t: REDIRECT, location: res.redirect.get)) + if res.redirect != nil: + container.triggerEvent(ContainerEvent(t: REDIRECT, request: res.redirect)) if res.contentType != "": container.contenttype = some(res.contentType) return container.iface.load() |