Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed query string not built properly from JSON param in request()(ex…

…pect for GET).
  • Loading branch information...
commit d8f3b79753e8fd659c0f9f5015cdfb5e6c6f7278 1 parent 4da5978
@nicolas-rempulski nicolas-rempulski authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 source/ajax/Ajax.js
View
12 source/ajax/Ajax.js
@@ -44,7 +44,17 @@ enyo.kind({
var uri = parts.shift() || "";
var args = parts.length ? (parts.join("?").split("&")) : [];
//
- var body = enyo.isString(inParams) ? inParams : enyo.Ajax.objectToQuery(inParams);
+ var body = null;
+ //
+ if(enyo.isString(inParams)){
+ //If inParams parameter is a string, use it as request body
+ body = inParams;
+ }
+ else{
+ //If inParams parameter is not a string, build a query from it
+ args.push(enyo.Ajax.objectToQuery(inParams))
+ }
+ //
if (this.method == "GET") {
if (body) {
args.push(body);
Please sign in to comment.
Something went wrong with that request. Please try again.