aboutsummaryrefslogtreecommitdiffstats
path: root/adapter/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'adapter/protocol')
-rw-r--r--adapter/protocol/file.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/adapter/protocol/file.nim b/adapter/protocol/file.nim
index d05d558c..fbd14479 100644
--- a/adapter/protocol/file.nim
+++ b/adapter/protocol/file.nim
@@ -96,6 +96,11 @@ proc loadFile(istream: Stream) =
break
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 opath = getEnv("MAPPED_URI_PATH")
let path = percentDecode(opath)
let istream = newFileStream(path, fmRead)