Mercurial > hg > orthanc
diff Core/HttpServer/HttpOutput.cpp @ 50:a15e90e5d6fc
rename in code
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 05 Sep 2012 15:50:12 +0200 |
parents | 9be852ad33d2 |
children | c996319e90bc |
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/HttpOutput.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,11 +23,11 @@ #include <vector> #include <stdio.h> #include <boost/lexical_cast.hpp> -#include "../PalantirException.h" +#include "../PalanthirException.h" #include "../Toolbox.h" -#include "../../PalantirCppClient/HttpException.h" +#include "../../PalanthirCppClient/HttpException.h" -namespace Palantir +namespace Palanthir { void HttpOutput::SendString(const std::string& s) { @@ -82,26 +82,26 @@ void HttpOutput::SendMethodNotAllowedError(const std::string& allowed) { std::string s = - "HTTP/1.1 405 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_405_MethodNotAllowed)) + + "HTTP/1.1 405 " + std::string(HttpException::GetDescription(Palanthir_HttpStatus_405_MethodNotAllowed)) + "\r\nAllow: " + allowed + "\r\n\r\n"; Send(&s[0], s.size()); } - void HttpOutput::SendHeader(Palantir_HttpStatus status) + void HttpOutput::SendHeader(Palanthir_HttpStatus status) { - if (status == Palantir_HttpStatus_200_Ok || - status == Palantir_HttpStatus_405_MethodNotAllowed) + if (status == Palanthir_HttpStatus_200_Ok || + status == Palanthir_HttpStatus_405_MethodNotAllowed) { - throw PalantirException("Please use the dedicated methods to this HTTP status code in HttpOutput"); + throw PalanthirException("Please use the dedicated methods to this HTTP status code in HttpOutput"); } SendHeaderInternal(status); } - void HttpOutput::SendHeaderInternal(Palantir_HttpStatus status) + void HttpOutput::SendHeaderInternal(Palanthir_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(Palantir_HttpStatus_500_InternalServerError); + SendHeaderInternal(Palanthir_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(Palantir_HttpStatus_301_MovedPermanently)) + + "HTTP/1.1 301 " + std::string(HttpException::GetDescription(Palanthir_HttpStatus_301_MovedPermanently)) + "\r\nLocation: " + path + "\r\n\r\n"; Send(&s[0], s.size());