Add test for nginx reverse proxy rule
This commit is contained in:
@@ -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", ->
|
||||
|
||||
Reference in New Issue
Block a user