framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

There is a bug when I use the POST method to send a request contains an `&` character

Open BelinChung opened this issue 11 years ago • 2 comments

Code used to reproduce the bug

$$.ajax({
    url: 'http://127.0.0.1:8081?a=test',
    type: 'POST',
    data: {
        password: 'pass&word'
    },
    success:function(data){
        console.log(data);
    }
})

Maybe this is the cause of the bug https://github.com/nolimits4web/Framework7/blob/master/src/js/dom7-ajax.js#L161

BelinChung avatar Apr 03 '15 02:04 BelinChung

why _data=_data.split("&") ..... only

var s = "";
if (param.data) {
    for (var name in param.data) {
        if (param.data.hasOwnProperty(name)) {
    s += encodeURIComponent(name) + "=" + encodeURIComponent(param.data[name])+"&";
        }
    }
}

over

wych1987 avatar Apr 03 '15 02:04 wych1987

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jun 26 '18 05:06 lock[bot]