aboutsummaryrefslogtreecommitdiffstats
path: root/adapter/protocol
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-12-21 17:53:22 +0100
committerbptato <nincsnevem662@gmail.com>2023-12-21 17:53:22 +0100
commit3563b6e5d67e88dd9f7a261b65d15d9360e979bd (patch)
treea4eda599c4a9f953dde3941c9254537fba04fd1e /adapter/protocol
parent770a7116c39ebde9433b973c2fa881f60f8804a9 (diff)
downloadchawan-3563b6e5d67e88dd9f7a261b65d15d9360e979bd.tar.gz
file: remove symlink code
It was never reached anyway.
Diffstat (limited to 'adapter/protocol')
-rw-r--r--adapter/protocol/file.nim23
1 files changed, 4 insertions, 19 deletions
diff --git a/adapter/protocol/file.nim b/adapter/protocol/file.nim
index 67bea420..b77f725f 100644
--- a/adapter/protocol/file.nim
+++ b/adapter/protocol/file.nim
@@ -65,19 +65,6 @@ proc loadDir(path, opath: string) =
stdout.write(makeDirlist(items))
stdout.write("\n</PRE>\n</BODY>\n</HTML>\n")
-proc loadSymlink(path: string) =
- stdout.write("Content-Type: text/html\n\n")
- let sl = expandSymlink(path)
- stdout.write("""
-<HTML>
-<HEAD>
-<TITLE>Symlink view<TITLE>
-</HEAD>
-<BODY>
-Symbolic link to <A HREF="""" & sl & """">""" & sl & """</A></br>
-</BODY>
-</HTML>""")
-
proc loadFile(f: File) =
# No headers, we'll let the browser figure out the file type.
stdout.write("\n")
@@ -93,10 +80,10 @@ proc loadFile(f: File) =
proc main() =
if getEnv("MAPPED_URI_HOST") != "":
- let code = int(ERROR_INVALID_URL)
- stdout.write("Cha-Control: ConnectionError " & $code &
- " cannot use host in file")
- return
+ let code = int(ERROR_INVALID_URL)
+ stdout.write("Cha-Control: ConnectionError " & $code &
+ " cannot use host in file")
+ return
let opath = getEnv("MAPPED_URI_PATH")
let path = percentDecode(opath)
var f: File
@@ -104,8 +91,6 @@ proc main() =
loadFile(f)
elif dirExists(path):
loadDir(path, opath)
- elif symlinkExists(path):
- loadSymlink(path)
else:
let code = int(ERROR_FILE_NOT_FOUND)
stdout.write("Cha-Control: ConnectionError " & $code)