aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-08-03 01:14:41 +0200
committerbptato <nincsnevem662@gmail.com>2024-08-03 01:54:35 +0200
commit4c64687290c908cd791a058dede9bd4f2a1c7757 (patch)
tree4e72720aa016320a02d19b4a051b9b9916b714f9 /src/types
parent270cf870eb84e80f2de1f2be64b682849ca55585 (diff)
downloadchawan-4c64687290c908cd791a058dede9bd4f2a1c7757.tar.gz
loader: move back data URL handling
data URIs can get megabytes long; however, you can only stuff so many bytes into the envp. (This was thwarting my efforts to view pandoc- generated standalone HTML in Chawan.) So put `data:' back into the loader process.
Diffstat (limited to 'src/types')
-rw-r--r--src/types/urimethodmap.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/types/urimethodmap.nim b/src/types/urimethodmap.nim
index 4cb5b9ae..81876c26 100644
--- a/src/types/urimethodmap.nim
+++ b/src/types/urimethodmap.nim
@@ -32,7 +32,7 @@ func rewriteURL(pattern, surl: string): string =
result &= '%'
type URIMethodMapResult* = enum
- URI_RESULT_NOT_FOUND, URI_RESULT_SUCCESS, URI_RESULT_WRONG_URL
+ ummrNotFound, ummrSuccess, ummrWrongURL
proc findAndRewrite*(this: URIMethodMap; url: var URL): URIMethodMapResult =
let protocol = url.protocol
@@ -40,10 +40,10 @@ proc findAndRewrite*(this: URIMethodMap; url: var URL): URIMethodMapResult =
let surl = this.map[protocol].rewriteURL($url)
let x = newURL(surl)
if x.isNone:
- return URI_RESULT_WRONG_URL
+ return ummrWrongURL
url = x.get
- return URI_RESULT_SUCCESS
- return URI_RESULT_NOT_FOUND
+ return ummrSuccess
+ return ummrNotFound
proc insert(this: var URIMethodMap; k, v: string) =
if not this.map.hasKeyOrPut(k, v) and k.startsWith("img-codec+"):