Mercurial > hg > orthanc
diff Core/HttpServer/HttpOutput.cpp @ 43:9be852ad33d2
rename for c
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 04 Sep 2012 09:59:34 +0200 |
parents | 3a584803783e |
children | a15e90e5d6fc |
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.cpp Mon Sep 03 11:34:00 2012 +0200 +++ b/Core/HttpServer/HttpOutput.cpp Tue Sep 04 09:59:34 2012 +0200 @@ -82,17 +82,17 @@ void HttpOutput::SendMethodNotAllowedError(const std::string& allowed) { std::string s = - "HTTP/1.1 405 " + std::string(HttpException::GetDescription(HttpStatus_405_MethodNotAllowed)) + + "HTTP/1.1 405 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_405_MethodNotAllowed)) + "\r\nAllow: " + allowed + "\r\n\r\n"; Send(&s[0], s.size()); } - void HttpOutput::SendHeader(HttpStatus status) + void HttpOutput::SendHeader(Palantir_HttpStatus status) { - if (status == HttpStatus_200_Ok || - status == HttpStatus_405_MethodNotAllowed) + if (status == Palantir_HttpStatus_200_Ok || + status == Palantir_HttpStatus_405_MethodNotAllowed) { throw PalantirException("Please use the dedicated methods to this HTTP status code in HttpOutput"); } @@ -101,7 +101,7 @@ } - void HttpOutput::SendHeaderInternal(HttpStatus status) + void HttpOutput::SendHeaderInternal(Palantir_HttpStatus status) { std::string s = "HTTP/1.1 " + boost::lexical_cast<std::string>(status) + @@ -136,7 +136,7 @@ FILE* fp = fopen(path.c_str(), "rb"); if (!fp) { - SendHeaderInternal(HttpStatus_500_InternalServerError); + SendHeaderInternal(Palantir_HttpStatus_500_InternalServerError); return; } @@ -180,7 +180,7 @@ void HttpOutput::Redirect(const std::string& path) { std::string s = - "HTTP/1.1 301 " + std::string(HttpException::GetDescription(HttpStatus_301_MovedPermanently)) + + "HTTP/1.1 301 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_301_MovedPermanently)) + "\r\nLocation: " + path + "\r\n\r\n"; Send(&s[0], s.size());