Mercurial > hg > orthanc
comparison Core/HttpServer/HttpOutput.cpp @ 474:a9693dc7089c
move tostring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 15 Jul 2013 17:25:53 +0200 |
parents | c9a5d72f8481 |
children | 72cca077abf8 |
comparison
equal
deleted
inserted
replaced
473:c9a5d72f8481 | 474:a9693dc7089c |
---|---|
102 | 102 |
103 | 103 |
104 void HttpOutput::SendMethodNotAllowedError(const std::string& allowed) | 104 void HttpOutput::SendMethodNotAllowedError(const std::string& allowed) |
105 { | 105 { |
106 std::string s = | 106 std::string s = |
107 "HTTP/1.1 405 " + std::string(HttpException::GetDescription(HttpStatus_405_MethodNotAllowed)) + | 107 "HTTP/1.1 405 " + std::string(Toolbox::ToString(HttpStatus_405_MethodNotAllowed)) + |
108 "\r\nAllow: " + allowed + | 108 "\r\nAllow: " + allowed + |
109 "\r\n\r\n"; | 109 "\r\n\r\n"; |
110 Send(&s[0], s.size()); | 110 Send(&s[0], s.size()); |
111 } | 111 } |
112 | 112 |
125 | 125 |
126 void HttpOutput::SendHeaderInternal(HttpStatus status) | 126 void HttpOutput::SendHeaderInternal(HttpStatus status) |
127 { | 127 { |
128 std::string s = "HTTP/1.1 " + | 128 std::string s = "HTTP/1.1 " + |
129 boost::lexical_cast<std::string>(status) + | 129 boost::lexical_cast<std::string>(status) + |
130 " " + std::string(HttpException::GetDescription(status)) + | 130 " " + std::string(Toolbox::ToString(status)) + |
131 "\r\n\r\n"; | 131 "\r\n\r\n"; |
132 Send(&s[0], s.size()); | 132 Send(&s[0], s.size()); |
133 } | 133 } |
134 | 134 |
135 | 135 |
188 | 188 |
189 | 189 |
190 void HttpOutput::Redirect(const std::string& path) | 190 void HttpOutput::Redirect(const std::string& path) |
191 { | 191 { |
192 std::string s = | 192 std::string s = |
193 "HTTP/1.1 301 " + std::string(HttpException::GetDescription(HttpStatus_301_MovedPermanently)) + | 193 "HTTP/1.1 301 " + std::string(Toolbox::ToString(HttpStatus_301_MovedPermanently)) + |
194 "\r\nLocation: " + path + | 194 "\r\nLocation: " + path + |
195 "\r\n\r\n"; | 195 "\r\n\r\n"; |
196 Send(&s[0], s.size()); | 196 Send(&s[0], s.size()); |
197 } | 197 } |
198 } | 198 } |