projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
frontend_net: handle X-Forwarded-For
[metaproxy-moved-to-github.git]
/
src
/
torus.cpp
diff --git
a/src/torus.cpp
b/src/torus.cpp
index
6ee010f
..
bd0a63b
100644
(file)
--- a/
src/torus.cpp
+++ b/
src/torus.cpp
@@
-29,13
+29,20
@@
namespace mp = metaproxy_1;
xmlDoc *mp::get_searchable(mp::Package &package,
std::string url_template, const std::string &db,
xmlDoc *mp::get_searchable(mp::Package &package,
std::string url_template, const std::string &db,
+ const std::string &query,
const std::string &realm,
const std::string &proxy)
{
const std::string &realm,
const std::string &proxy)
{
- // http://newmk2.indexdata.com/torus2/searchable.ebsco/records/?query=udb=aberdeenUni
+ // http://mk2.indexdata.com/torus2/searchable/records/?query=udb%3d%db
+ // or
+ // http://mk2.indexdata.com/torus2/searchable/records/?query=%query
xmlDoc *doc = 0;
size_t found;
xmlDoc *doc = 0;
size_t found;
+ found = url_template.find("%query");
+ if (found != std::string::npos)
+ url_template.replace(found, 6, mp::util::uri_encode(query));
+
found = url_template.find("%db");
if (found != std::string::npos)
url_template.replace(found, 3, mp::util::uri_encode(db));
found = url_template.find("%db");
if (found != std::string::npos)
url_template.replace(found, 3, mp::util::uri_encode(db));