Fix GET form submission
This commit is contained in:
1 parent
b7fc3457de
commit
a5b51f34df
3 files changed
+45
-16
No files matched your search
@@ -0,0 +1,10 @@
|
||||
module.exports = function(uri, key, value) {
|
||||
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i")
|
||||
var separator = uri.indexOf("?") !== -1 ? "&" : "?"
|
||||
if (uri.match(re)) {
|
||||
return uri.replace(re, "$1" + key + "=" + value + "$2")
|
||||
}
|
||||
else {
|
||||
return uri + separator + key + "=" + value
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user