Ajax: Overwrite s.contentType with content-type header value, if any
commit7fb90a6beaeffe16699800f73746748f6a5cc2de
authorChristian Wenz <christian@wenz.org>
Mon, 6 Apr 2020 19:15:55 +0000 (6 21:15 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Apr 2020 19:15:55 +0000 (6 21:15 +0200)
tree7236b990a72a361020ced04f24492b0171444dee
parent90fed4b453a5becdb7f173d9e3c1492390a1441f
Ajax: Overwrite s.contentType with content-type header value, if any

This fixes the issue of "%20" in POST data being replaced with "+"
even for requests with content-type different from
"application/x-www-form-urlencoded", e.g. for "application/json".

Fixes gh-4119
Closes gh-4650

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>
src/ajax.js
test/unit/ajax.js