view mod_http_debug/mod_http_debug.lua @ 5440:82a14082be3f

mod_auth_oauth_external: Allow different username in PLAIN vs final JID Mastodon for example having email addresses usernames in login, but a different username in the service itself. Thanks to @tcit@social.tcit.fr for the pointer to a usable validation endpoint for Mastodon, allowing this to be tested.
author Kim Alvefur <zash@zash.se>
date Wed, 10 May 2023 13:52:31 +0200
parents 10fcfa7e62a1
children 91564b57e595
line wrap: on
line source

local json = require "util.json"

module:depends("http")
module:provides("http", {
		route = {
			GET = function(event)
				local request = event.request;
				return {
					status_code = 200;
					headers = {
						content_type = "application/json",
					},
					body = json.encode {
						body = request.body;
						headers = request.headers;
						httpversion = request.httpversion;
						ip = request.ip;
						method = request.method;
						path = request.path;
						secure = request.secure;
						url = request.url;
					}
				}
			end;
		}
	})