root/http/error_resource.cc

Revision 751fac6b567d675afee10e627efb5cf786ce5c83, 1.4 KB (checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 21 months ago)

[http::request] Cleanup

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

  • Property mode set to 100644
Line 
1/*  This file is part of Alue, the multiprotocol Internet discussion daemon
2
3    Copyright © 2009, 2010 Antti-Juhani Kaijanaho
4
5    Alue is free software: you can redistribute it and/or modify it
6    under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    Alue is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with Alue.  If not, see <http://www.gnu.org/licenses/>.
17
18 */
19
20#include "error_resource.hh"
21#include "request.hh"
22
23#include "../html/util.hh"
24#include "../tlate/tlate.hh"
25
26namespace http
27{
28        void error_resource::set_attributes(boost::shared_ptr<request> req,
29                                            tlate::data_model::ptr am)
30        {
31                using html::quote;
32                am->insert("heading", heading);
33                am->insert("host", req->get_host());
34                std::string rpath = req->get_path();
35                std::string query = req->get_form_as_query();
36                if (!query.empty()) rpath += "?" + query;
37                am->insert("path", rpath);
38        }
39}
Note: See TracBrowser for help on using the browser.