Mercurial > prosody-modules
comparison mod_sasl2_bind2/mod_sasl2_bind2.lua @ 5032:71a84474fcfb
mod_sasl2_bind2: Use correct method to get text
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 03 Sep 2022 17:45:03 +0100 |
| parents | 62cdd8170563 |
| children | 9afd98178011 |
comparison
equal
deleted
inserted
replaced
| 5031:62cdd8170563 | 5032:71a84474fcfb |
|---|---|
| 29 | 29 |
| 30 local function do_bind(session, bind_request) | 30 local function do_bind(session, bind_request) |
| 31 local resource; | 31 local resource; |
| 32 | 32 |
| 33 local client_id_tag = bind_request:get_child("client-id"); | 33 local client_id_tag = bind_request:get_child("client-id"); |
| 34 local client_id = client_id_tag and client_id_tag:text() or session.client_id; | 34 local client_id = client_id_tag and client_id_tag:get_text() or session.client_id; |
| 35 if client_id and client_id ~= "" then | 35 if client_id and client_id ~= "" then |
| 36 local tag = client_id_tag and client_id_tag.attr.tag or "client"; | 36 local tag = client_id_tag and client_id_tag.attr.tag or "client"; |
| 37 resource = ("%s~%s"):format(tag, base64.encode(sha1(client_id):sub(1, 9))); | 37 resource = ("%s~%s"):format(tag, base64.encode(sha1(client_id):sub(1, 9))); |
| 38 end | 38 end |
| 39 | 39 |
