{
char *lbuf = NULL;
switch_status_t status = SWITCH_STATUS_SUCCESS;
- char *http = NULL;
+ char *http = NULL, *type = NULL;
int argc;
char *argv[25] = { 0 };
if (stream->param_event) {
http = switch_event_get_header(stream->param_event, "http-host");
+ type = switch_event_get_header(stream->param_event, "content-type");
}
if (http) {
/* Output must be to a web browser */
- stream->write_function(stream, "<pre>\n");
+ if (type && !strcasecmp(type, "text/html")) {
+ stream->write_function(stream, "<pre>\n");
+ }
}
if (!(lbuf = strdup(cmd))) {
char *fs_user = NULL, *fs_domain = NULL;
char *path_info = NULL;
abyss_bool ret = TRUE;
- int html = 0, text = 0;
+ int html = 0, text = 0, xml = 0;
stream.data = r;
stream.write_function = http_stream_write;
} else if ((command = strstr(r->requestInfo.uri, "/txtapi/"))) {
command += 8;
text++;
+ } else if ((command = strstr(r->requestInfo.uri, "/xmlapi/"))) {
+ command += 8;
+ xml++;
} else {
return FALSE;
}
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/html");
else if (text)
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/plain");
+ else if (xml)
+ switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "Content-type", "text/xml");
if (fs_user)
switch_event_add_header_string(stream.param_event, SWITCH_STACK_BOTTOM, "FreeSWITCH-User", fs_user);
if (fs_domain)