Skip to content

Error 413 while saving configuration #101

Description

@demik

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions