Merge pull request #47 from GavinRay97/patch-1

Fix json-enc extension content-type header set
This commit is contained in:
chg20 2020-05-27 20:19:57 -07:00 committed by GitHub
commit fe158bac0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
htmx.defineExtension('json-enc', {
encodeParameters : function(xhr, parameters, elt) {
xhr.requestHeaders['Content-Type'] = 'application/json';
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.overrideMimeType('text/json');
return (JSON.stringify(parameters));
}
});
});