diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-02-09 23:01:01 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-02-09 23:01:01 +0900 |
| commit | 1a9d3b77119e0da66007ec111f0d4b987c585123 (patch) | |
| tree | ba7203ba4dd6837e46dfad940acce50637880c82 /src/HttpServer.cc | |
| parent | ffce1848cae817b6120db432d236daa12eacd266 (diff) | |
Added Date, Expires and Cache-Control response header field to XML-RPC response headers.
Diffstat (limited to 'src/HttpServer.cc')
| -rw-r--r-- | src/HttpServer.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc index aee010d4..15016501 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -48,6 +48,7 @@ #include "a2functional.h" #include "fmt.h" #include "SocketRecvBuffer.h" +#include "TimeA2.h" namespace aria2 { @@ -151,10 +152,14 @@ void HttpServer::feedResponse(const std::string& status, const std::string& text, const std::string& contentType) { + std::string httpDate = Time().toHTTPDate(); std::string header = "HTTP/1.1 "; strappend(header, status, "\r\n", - "Content-Type: ", contentType, "\r\n", - "Content-Length: ", util::uitos(text.size()), "\r\n"); + "Date: ", httpDate, "\r\n", + "Content-Type: ", contentType, "\r\n"); + strappend(header, "Content-Length: ", util::uitos(text.size()), "\r\n", + "Expires: ", httpDate, "\r\n", + "Cache-Control: no-cache\r\n"); if(supportsGZip()) { header += "Content-Encoding: gzip\r\n"; } |
