Mercurial > prosody-modules
annotate mod_http_debug/mod_http_debug.lua @ 5467:1c78a97a1091
mod_http_oauth2: Add a special "xmpp" scope that grants the users' default role
This will be the first step towards defining a standard set of XMPP
scopes. "xmpp" behaves as an alias for the user's default role, so that
the client does not need to know about the various prosody:* roles.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 17 May 2023 19:40:27 +0200 |
parents | 10fcfa7e62a1 |
children | 91564b57e595 |
rev | line source |
---|---|
5333
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local json = require "util.json" |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 module:depends("http") |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 module:provides("http", { |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 route = { |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 GET = function(event) |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 local request = event.request; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 return { |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 status_code = 200; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 headers = { |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 content_type = "application/json", |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 }, |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 body = json.encode { |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 body = request.body; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 headers = request.headers; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 httpversion = request.httpversion; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 ip = request.ip; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 method = request.method; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 path = request.path; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 secure = request.secure; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 url = request.url; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 } |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 } |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 end; |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 } |
10fcfa7e62a1
mod_http_debug: Module that echos back HTTP request info for debugging
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 }) |