Add test for nginx reverse proxy rule

This commit is contained in:
2025-06-12 15:27:23 -07:00
parent 1e33d2770a
commit 74632be2e1
6 changed files with 38 additions and 34 deletions

View File

@@ -104,12 +104,14 @@ describe "http://miti.sh/posts", ->
assert.same request\body!\match("<title>(.*)</title>"), "miti.sh · Posts"
describe "http://git.miti.sh", ->
it "doesn't find it?", ->
it "reverse proxies request to unix socket", ->
os.execute "mkdir /run/gitea"
p = io.popen "luajit unixstreamsrvr.lua"
os.execute("sleep 1")
os.execute("chown -R nobody /run/gitea")
request = req "http://git.miti.sh"
require("moon").p request\body!
require("moon").p request\header!
-- assert.same request\statusCode!, 404
-- assert.same request\statusMessage!, "Not Found"
assert.is_not_nil p\read"*a"\match "Host: git.miti.sh"
describe "http://apps.miti.sh", ->
it "doesn't find it", ->