Fix incorrect short URL for POST requests made by Rhymix.ajax()

This commit is contained in:
Kijin Sung 2025-05-21 15:07:15 +09:00
parent 3c741ec8bc
commit 3fb9d0acaa

View file

@ -393,7 +393,7 @@ Rhymix.ajax = function(action, params, success, error) {
// Extract action info
if (!action) {
if (params instanceof FormData) {
action = (params.get('mid') || params.get('module')) + '.' + params.get('act');
action = (params.get('module') || params.get('mid')) + '.' + params.get('act');
if (action === '.') {
action = null;
}
@ -410,11 +410,13 @@ Rhymix.ajax = function(action, params, success, error) {
// Add action to URL if the current rewrite level supports it
let url = this.URI(window.request_uri).pathname();
/*
if (this.getRewriteLevel() >= 2 && action !== null) {
url = url + action.replace('.', '/');
} else {
url = url + 'index.php';
}
*/
// Add CSRF token and AJAX compatibility hint
const headers = {};