Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 413 while saving configuration #101

Open
demik opened this issue May 17, 2023 · 0 comments
Open

Error 413 while saving configuration #101

demik opened this issue May 17, 2023 · 0 comments

Comments

@demik
Copy link

demik commented May 17, 2023

We had an issue saving configuration after a while.
"Save Buton" would be doing nothing and resulted of an error 413 in node console

POST /dhcp_config_save 413 77.853 ms - 108
Turns out the default size limits for POST data are too small. Our configuration file is a little less than 100kB.
Increasing default values resolve this issue. Proposed patch:

index e77586f..81a9f06 100644
--- a/app.js
+++ b/app.js
@@ -12,8 +12,8 @@ var glass_config = json_file.readFileSync('config/glass_config.json');
  * Init Express plugins
  */
 app.use(logger('dev'));
-app.use(bodyParser.json());
-app.use(bodyParser.urlencoded({extended: false}));
+app.use(bodyParser.json({limit: '1mb'}));
+app.use(bodyParser.urlencoded({limit: '1mb', extended: false}));
 app.use(cookieParser());
 app.use(express.static(path.join(__dirname, 'public')));

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant