#include "config.hpp"
#include <metaproxy/filter.hpp>
#include <metaproxy/package.hpp>
#include <metaproxy/util.hpp>
#include "filter_http_rewrite.hpp"
#include "html_parser.hpp"
#include <yaz/zgdu.h>
#include <yaz/log.h>
#include <stack>
#include <boost/regex.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <map>
Go to the source code of this file.
|
static bool | embed_quoted_literal (std::string &content, std::map< std::string, std::string > &vars, mp::filter::HttpRewrite::RulePtr ruleptr, bool html_context, std::list< boost::regex > &skip_list) |
|
static mp::filter::Base * | filter_creator () |
|
◆ embed_quoted_literal()
static bool embed_quoted_literal |
( |
std::string & |
content, |
|
|
std::map< std::string, std::string > & |
vars, |
|
|
mp::filter::HttpRewrite::RulePtr |
ruleptr, |
|
|
bool |
html_context, |
|
|
std::list< boost::regex > & |
skip_list |
|
) |
| |
|
static |
Definition at line 480 of file filter_http_rewrite.cpp.
487 bool replace =
false;
489 const char *cp = content.c_str();
490 const char *cp0 = cp;
493 if (html_context && !strncmp(cp,
""", 6))
496 res.append(cp0, cp - cp0);
500 if (!strncmp(cp,
""", 6))
508 std::string s(cp0, cp - cp0);
509 if (ruleptr->test_patterns(vars, s,
true, skip_list))
514 else if (*cp ==
'"' || *cp ==
'\'')
518 res.append(cp0, cp - cp0);
522 if (cp[-1] !=
'\\' && *cp == m)
530 std::string s(cp0, cp - cp0);
531 if (ruleptr->test_patterns(vars, s,
true, skip_list))
536 else if (*cp ==
'/' && cp[1] ==
'/')
538 while (cp[1] && cp[1] !=
'\n')
543 res.append(cp0, cp - cp0);
Referenced by metaproxy_1::filter::HttpRewrite::Within::exec(), and metaproxy_1::filter::HttpRewrite::Content::quoted_literal().
◆ filter_creator()
static mp::filter::Base* filter_creator |
( |
| ) |
|
|
static |
◆ metaproxy_1_filter_http_rewrite
struct metaproxy_1_filter_struct metaproxy_1_filter_http_rewrite |