Software /
code /
prosody-modules
Comparison
mod_http_debug/mod_http_debug.lua @ 5673:0eb2d5ea2428
merge
author | Stephen Paul Weber <singpolyma@singpolyma.net> |
---|---|
date | Sat, 06 May 2023 19:40:23 -0500 |
parent | 5333:10fcfa7e62a1 |
child | 5490:91564b57e595 |
comparison
equal
deleted
inserted
replaced
5672:2c69577b28c2 | 5673:0eb2d5ea2428 |
---|---|
1 local json = require "util.json" | |
2 | |
3 module:depends("http") | |
4 module:provides("http", { | |
5 route = { | |
6 GET = function(event) | |
7 local request = event.request; | |
8 return { | |
9 status_code = 200; | |
10 headers = { | |
11 content_type = "application/json", | |
12 }, | |
13 body = json.encode { | |
14 body = request.body; | |
15 headers = request.headers; | |
16 httpversion = request.httpversion; | |
17 ip = request.ip; | |
18 method = request.method; | |
19 path = request.path; | |
20 secure = request.secure; | |
21 url = request.url; | |
22 } | |
23 } | |
24 end; | |
25 } | |
26 }) |