# HG changeset patch # User Kim Alvefur # Date 1703286090 -3600 # Node ID fdf3056021dc10735f7cb049f0c0a32f98b9ffa1 # Parent 03477980f1a9e0b06f27663a69b126effaecee58 mod_http_oauth2: Tweak fallback error text Since the oauth error is more like the error condition, a symbolic error code, not the most human-friendly. Many error cases do have human-readable error descriptions that should be fine on their own, or changed to be. As a fallback, capitalize the error name. diff -r 03477980f1a9 -r fdf3056021dc mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Thu Dec 21 18:26:42 2023 +0100 +++ b/mod_http_oauth2/mod_http_oauth2.lua Sat Dec 23 00:01:30 2023 +0100 @@ -252,7 +252,7 @@ type = "modify"; condition = "bad-request"; code = err_name == "invalid_client" and 401 or 400; - text = err_desc and (err_name..": "..err_desc) or err_name; + text = err_desc or err_name:gsub("^.", string.upper):gsub("_", " "); extra = { oauth2_response = { error = err_name, error_description = err_desc } }; }); end