From c45bb17a13e79cfb3eceb673daa8ba0281994a4a Mon Sep 17 00:00:00 2001 From: Denis Itskovich Date: Mon, 5 Oct 2015 21:19:05 +0300 Subject: [PATCH] Fixing #67 - using async with urlArgs --- src/async.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/async.js b/src/async.js index fdcae3b..b34645e 100644 --- a/src/async.js +++ b/src/async.js @@ -16,9 +16,10 @@ define(function(){ } function formatUrl(name, id){ - var paramRegex = /!(.+)/, + var paramRegex = /!([^?]+)/, url = name.replace(paramRegex, ''), - param = (paramRegex.test(name))? name.replace(/.+!/, '') : DEFAULT_PARAM_NAME; + match = paramRegex.exec(name), + param = (match != null) ? match[1] : DEFAULT_PARAM_NAME; url += (url.indexOf('?') < 0)? '?' : '&'; return url + param +'='+ id; }