Skip to content

Node.js based forum software built for the modern web

fix: #13909, show 413 error properly

Barış Soner Uşaklı39af83837692
diff --git a/install/package.json b/install/package.json
index 3248025468..3fccc1d277 100644
--- a/install/package.json
+++ b/install/package.json
@@ -97,7 +97,7 @@
"multer": "2.0.2",
"nconf": "0.13.0",
"nodebb-plugin-2factor": "7.6.1",
- "nodebb-plugin-composer-default": "10.3.1",
+ "nodebb-plugin-composer-default": "10.3.2",
"nodebb-plugin-dbsearch": "6.3.5",
"nodebb-plugin-emoji": "6.0.5",
"nodebb-plugin-emoji-android": "4.1.1",
diff --git a/public/language/en-GB/error.json b/public/language/en-GB/error.json
index b32ccfedfb..61231b11a8 100644
--- a/public/language/en-GB/error.json
+++ b/public/language/en-GB/error.json
@@ -292,6 +292,7 @@
"api.401": "A valid login session was not found. Please log in and try again.",
"api.403": "You are not authorised to make this call",
"api.404": "Invalid API call",
+ "api.413": "The request payload is too large",
"api.426": "HTTPS is required for requests to the write api, please re-send your request via HTTPS",
"api.429": "You have made too many requests, please try again later",
"api.500": "An unexpected error was encountered while attempting to service your request.",
diff --git a/public/src/modules/uploadHelpers.js b/public/src/modules/uploadHelpers.js
index 49ed9fd9fb..a465a44054 100644
--- a/public/src/modules/uploadHelpers.js
+++ b/public/src/modules/uploadHelpers.js
@@ -181,7 +181,7 @@ define('uploadHelpers', ['alerts'], function (alerts) {
'[[error:parse-error]]';
if (xhr && xhr.status === 413) {
- errorMsg = xhr.statusText || 'Request Entity Too Large';
+ errorMsg = '[[error:api.413]]';
}
alerts.error(errorMsg);
alerts.remove(alert_id);