|
|
|
@ -1309,5 +1309,33 @@ Octstr *mm7_soap_header_value(MSoapMsg_t *m, Octstr *header)
|
|
|
|
|
|
|
|
|
|
List *mm7_soap_headers(MSoapMsg_t *m)
|
|
|
|
|
{
|
|
|
|
|
return m ? http_header_duplicate(m->envelope) : NULL;
|
|
|
|
|
List *l;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (m == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
l = http_create_empty_headers();
|
|
|
|
|
for (i = 0; i < gwlist_len(m->envelope); i++) {
|
|
|
|
|
Octstr *n = NULL, *v = NULL;
|
|
|
|
|
|
|
|
|
|
http_header_get(m->envelope, i, &n, &v);
|
|
|
|
|
|
|
|
|
|
if (!n || !v)
|
|
|
|
|
goto loop;
|
|
|
|
|
if (octstr_str_case_compare(n, "From") == 0 ||
|
|
|
|
|
octstr_str_case_compare(n, "To") == 0 ||
|
|
|
|
|
octstr_str_case_compare(n, "Sender") == 0 ||
|
|
|
|
|
octstr_str_case_compare(n, "Cc") == 0 ||
|
|
|
|
|
octstr_str_case_compare(n, "Bcc") == 0 ||
|
|
|
|
|
octstr_str_case_compare(n, "SenderAddress") == 0) {
|
|
|
|
|
if (octstr_get_char(v, 0) == '+')
|
|
|
|
|
octstr_delete(v, 0, 2);
|
|
|
|
|
}
|
|
|
|
|
http_header_add(l, octstr_get_cstr(n), octstr_get_cstr(v));
|
|
|
|
|
loop:
|
|
|
|
|
octstr_destroy(n);
|
|
|
|
|
octstr_destroy(v);
|
|
|
|
|
}
|
|
|
|
|
return l;
|
|
|
|
|
}
|
|
|
|
|