Fawkes API
Fawkes Development Version
redirect_reply.cpp
1
2
/***************************************************************************
3
* redirect_reply.h - Web request reply for a redirect
4
*
5
* Created: Thu Feb 12 13:40:12 2009
6
* Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL file in the doc directory.
21
*/
22
23
#include <webview/redirect_reply.h>
24
25
namespace
fawkes
{
26
27
/** @class WebRedirectReply <webview/redirect_reply.h>
28
* Redirect reply for webview.
29
* This reply will cause an immediate redirect from the requested page
30
* to the given URL. THe URL can be local as well as remote. The redirect
31
* is done on the HTTP level with status code "moved permanently" and
32
* the new URL as "Location" HTTP header.
33
* @author Tim Niemueller
34
*/
35
36
/** Constructor.
37
* @param url the URL to redirect to
38
*/
39
WebRedirectReply::WebRedirectReply
(std::string url)
40
:
StaticWebReply
(
WebReply
::HTTP_MOVED_PERMANENTLY)
41
{
42
add_header
(
"Location"
, url);
43
}
44
45
}
// end namespace fawkes
fawkes::StaticWebReply
Static web reply.
Definition:
reply.h:136
fawkes::WebRedirectReply::WebRedirectReply
WebRedirectReply(std::string url)
Constructor.
Definition:
redirect_reply.cpp:39
fawkes::WebReply
Basic web reply.
Definition:
reply.h:34
fawkes::WebReply::add_header
void add_header(const std::string &header, const std::string &content)
Add a HTTP header.
Definition:
reply.cpp:123
fawkes
Fawkes library namespace.
src
libs
webview
redirect_reply.cpp
Generated by
1.9.4