1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-10 05:55:37 -05:00

Add proper http support

Fixes #223
This commit is contained in:
Zed
2021-01-08 02:25:43 +01:00
parent ecc8bc5a95
commit e1b3e9db76
8 changed files with 70 additions and 69 deletions

View File

@@ -39,10 +39,7 @@ proc createSearchRouter*(cfg: Config) =
redirect("/search?q=" & encodeUrl("#" & @"hash"))
get "/opensearch":
var url = ""
if cfg.useHttps:
url = "https://" & cfg.hostname & "/search?q="
else:
url = "http://" & cfg.hostname & "/search?q="
var url = if cfg.useHttps: "https://" else: "http://"
url &= cfg.hostname & "/search?q="
resp Http200, {"Content-Type": "application/opensearchdescription+xml"},
generateOpenSearchXML(cfg.title, cfg.hostname, url)