Mercurial > prosody-modules
comparison mod_http_admin_api/mod_http_admin_api.lua @ 5786:076b79eb747f
mod_http_admin_api: Abort request if no valid username
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 07 Dec 2023 15:43:47 +0000 |
parents | 671a6ad1f026 |
children | f76909ec1300 |
comparison
equal
deleted
inserted
replaced
5785:671a6ad1f026 | 5786:076b79eb747f |
---|---|
475 | 475 |
476 return 200; | 476 return 200; |
477 end | 477 end |
478 | 478 |
479 function update_user(event, username) | 479 function update_user(event, username) |
480 if not username then | |
481 return 400; | |
482 end | |
480 | 483 |
481 local request = event.request; | 484 local request = event.request; |
482 if request.headers.content_type ~= json_content_type | 485 if request.headers.content_type ~= json_content_type |
483 or (not request.body or #request.body == 0) then | 486 or (not request.body or #request.body == 0) then |
484 return 400; | 487 return 400; |