# HG changeset patch # User Kim Alvefur # Date 1724085562 -7200 # Node ID eef6cb08f9e7ab5211fcfd92021cb2c0b643cd72 # Parent d60e04d3996eae08221fd6b3a44f9665fce06439 mod_rest: Fix to allow underscores in path of HTTP GET to iq-get mapping A request like GET /rest/upload_request/{to} would fail because the pattern would not the underscore in "upload_request" diff -r d60e04d3996e -r eef6cb08f9e7 mod_rest/mod_rest.lua --- a/mod_rest/mod_rest.lua Sun Aug 11 16:19:37 2024 +0200 +++ b/mod_rest/mod_rest.lua Mon Aug 19 18:39:22 2024 +0200 @@ -149,7 +149,7 @@ -- (table, string) -> table local function amend_from_path(data, path) - local st_kind, st_type, st_to = path:match("^([mpi]%w+)/(%w+)/(.*)$"); + local st_kind, st_type, st_to = path:match("^([mpi]%w+)/([%w_]+)/(.*)$"); if not st_kind then return; end if st_kind == "iq" and st_type ~= "get" and st_type ~= "set" then -- GET /iq/disco/jid