Changeset 6787


Ignore:
Timestamp:
2004-02-12T15:06:37+13:00 (20 years ago)
Author:
jrm21
Message:

Tidied slightly so that we return the content type in get_cgihead_info,
otherwise the default gets printed and then we printed out another one.

It wasn't screwing up Phind's parsing or anything, but it's tidier now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/phindaction.cpp

    r2542 r6787  
    121121}
    122122
    123 void phindaction::get_cgihead_info (cgiargsclass &/*args*/, recptprotolistclass * /*protos*/,
     123void phindaction::get_cgihead_info (cgiargsclass &args, recptprotolistclass * /*protos*/,
    124124                    response_t &response,text_t &response_data,
    125125                    ostream &/*logout*/) {
    126126  response = content;
    127   response_data = "text/html";
     127  if (args["pxml"] == "1") {
     128    response_data = "text/xml";
     129  } else {
     130    response_data = "text/html";
     131  }
    128132}
    129133
     
    208212  // Output the header
    209213  if (XMLmode) {
    210     textout << "Content-type: text/plain\n\n"
    211         << "<phinddata id=\"" << phrase
     214    textout << "<phinddata id=\"" << phrase
    212215        << "\" text=\"" << word
    213216        << "\" tf=\"" << tf
     
    217220        << "\">\n";
    218221  } else {
    219     textout << "Content-type: text/html\n\n"
    220         << "<html><head><title>" << word << "</title></head>\n"
     222    textout << "<html><head><title>" << word << "</title></head>\n"
    221223        << "<body><center>\n"
    222224        << "<p><h1>" << word << "</h1>\n"
Note: See TracChangeset for help on using the changeset viewer.