X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/b92547a5de3a3fb4f14a2bea4a4e776b8da3cb5c..df4733677cb16642b53628d22e4d927aadad8b27:/Server/src/httpheaders.cpp diff --git a/Server/src/httpheaders.cpp b/Server/src/httpheaders.cpp index 89d8de4..65d5adc 100644 --- a/Server/src/httpheaders.cpp +++ b/Server/src/httpheaders.cpp @@ -54,9 +54,13 @@ istream& operator>>(istream& is, HTTPHeaders& h) { string::size_type pos = sbuf.find(":"); if (pos == string::npos) { // FIXME poner mejores excepciones. - throw "Wrong header"; + throw string("Wrong header: ") + sbuf; } h[sbuf.substr(0, pos)] = String(sbuf.substr(pos + 1)).trim(); +#ifdef DEBUG + cerr << __FILE__ << " " << sbuf.substr(0, pos) << " = " + << h[sbuf.substr(0, pos)] << endl; +#endif // DEBUG return is; } @@ -66,7 +70,7 @@ ostream& operator<<(ostream& os, const HTTPHeaders& h) { #endif // DEBUG for (HTTPHeaders::const_iterator i = h.begin(); i != h.end(); ++i) { - os << i->first << ": " << i->second << "\r\n"; + os << i->first << ": " << i->second << "\n\r"; } return os; }