multitheftauto / mtasa-resources

This project maintains a list of up-to-date resources that come with Multi Theft Auto.
https://multitheftauto.com
MIT License
151 stars 151 forks source link

Use application/json in ajax resource #392

Closed botder closed 1 year ago

botder commented 2 years ago

Which resource(s) have this problem? ajax

Describe the bug The ajax resource is using Content-Type application/x-www-form-urlencoded instead of application/json when sending JSON data in the request body. The embedded web server parses the JSON data as if it were a bunch of key=value pairs.

https://github.com/multitheftauto/mtasa-resources/blob/3e4e3a4b8c3bf554b2d2b71ea987dc6ffec3be2b/%5Bweb%5D/ajax/ajax.js#L90

To Reproduce Inspect the http traffic when browsing the MTA server's web server.

Expected behavior Ajax uses application/json.