summaryrefslogtreecommitdiffabout
path: root/lib/openid_message.cc
Side-by-side diff
Diffstat (limited to 'lib/openid_message.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/openid_message.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/openid_message.cc b/lib/openid_message.cc
index 75e59b3..4b9179b 100644
--- a/lib/openid_message.cc
+++ b/lib/openid_message.cc
@@ -68,11 +68,12 @@ namespace opkele {
bool first;
string& rv;
+ const char *pfx;
- __om_query_builder(string& r,const basic_openid_message& m)
- : om(m), first(true), rv(r) {
+ __om_query_builder(const char *p,string& r,const basic_openid_message& m)
+ : om(m), first(true), rv(r), pfx(p) {
for_each(om.fields_begin(),om.fields_end(),*this);
}
- __om_query_builder(string& r,const basic_openid_message& m,const string& u)
- : om(m), first(true), rv(r) {
+ __om_query_builder(const char *p,string& r,const basic_openid_message& m,const string& u)
+ : om(m), first(true), rv(r), pfx(p) {
rv = u;
if(rv.find('?')==string::npos)
@@ -88,5 +89,6 @@ namespace opkele {
else
rv += '&';
- rv += "openid."; rv+= f;
+ if(pfx) rv += pfx;
+ rv+= f;
rv += '=';
rv += util::url_encode(om.get_field(f));
@@ -94,11 +96,11 @@ namespace opkele {
};
- string basic_openid_message::append_query(const string& url) const {
+ string basic_openid_message::append_query(const string& url,const char *pfx) const {
string rv;
- return __om_query_builder(rv,*this,url).rv;
+ return __om_query_builder(pfx,rv,*this,url).rv;
}
- string basic_openid_message::query_string() const {
+ string basic_openid_message::query_string(const char *pfx) const {
string rv;
- return __om_query_builder(rv,*this).rv;
+ return __om_query_builder(pfx,rv,*this).rv;
}