Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Node options when running with Angular-CLI

The application return 400 because it has 3 cookies, about 4k bytes each. I am trying to set the max-http-header-size property when running the application with angular cli. (ng serve)

The application works as expected when running in production.

Technologies:

angular CLI: 8.1.3
asp.net core 2.1.3

Tried running node --max-http-header-size=14000 but it does not work.

like image 385
Andrei S Avatar asked May 23 '26 18:05

Andrei S


1 Answers

The solution would be to set the value of the max header size before calling the ng serve function: node --max-http-header-size=100000 ./node_modules/@angular/cli/bin/ng serve

If you are using ASP.NET Core, this can be added in package.json:

"scripts": {
    "ng": "ng",
    "start": "node --max-http-header-size=100000 ./node_modules/@angular/cli/bin/ng serve",
    "build": "ng build"
}
like image 86
Andrei S Avatar answered May 26 '26 23:05

Andrei S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!