Minor tweaks to make the OAuth support work with Github.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@993192 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f75296a863
commit
8a21fca095
2 changed files with 10 additions and 3 deletions
|
@ -419,7 +419,7 @@ const failable<value> get(const string& url, const CURLSession& cs) {
|
|||
debug(val, "http::get::result");
|
||||
return val;
|
||||
}
|
||||
if (contains(ct, "text/javascript") || contains(ct, "application/json-rpc")) {
|
||||
if (contains(ct, "text/javascript") || contains(ct, "application/json")) {
|
||||
json::JSONContext cx;
|
||||
const value val(json::jsonValues(content(json::readJSON(ls, cx))));
|
||||
debug(val, "http::get::result");
|
||||
|
|
|
@ -204,7 +204,7 @@ const string url(const string& uri, request_rec* r) {
|
|||
/**
|
||||
* Escape a URI.
|
||||
*/
|
||||
const char escape_c2x[] = "0123456789abcdef";
|
||||
const char escape_c2x[] = "0123456789ABCDEF";
|
||||
const string escape(const string& uri) {
|
||||
debug(uri, "httpd::escape::uri");
|
||||
char* copy = (char*)apr_palloc(gc_current_pool(), 3 * length(uri) + 3);
|
||||
|
@ -248,8 +248,15 @@ const list<value> queryArg(const string& s) {
|
|||
return mklist<value>(c_str(car(t)), cadr(t));
|
||||
}
|
||||
|
||||
const string fixupQueryArgs(const string& a) {
|
||||
const list<string> t = tokenize("?", a);
|
||||
if (isNil(t) || isNil(cdr(t)))
|
||||
return a;
|
||||
return join("&", t);
|
||||
}
|
||||
|
||||
const list<list<value> > queryArgs(const string& a) {
|
||||
return map<string, list<value>>(queryArg, tokenize("&", a));
|
||||
return map<string, list<value>>(queryArg, tokenize("&", fixupQueryArgs(a)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue