-
Notifications
You must be signed in to change notification settings - Fork 392
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
Can't set limit in body parser #96
Comments
Also I've noticed, that if I'm not using If the controller class doesn't have |
So I've manage to overcome this by configuring my own Express server and then using @pleerock If you think that need to add the ability to configure it via Thanks, |
It is simple - if you don't have a special requirements, you use Also you can use global middlewares and configure there your 3rd party middlewares to work with routing-controllers. |
@19majkel94 author is talking about these lines. Right now body-parser will be enabled anyway without configuration. If we configure body parser on a global level, wont these lines of code override body parser of the currently executed route with empty configuration? |
@pleerock I would like to see a global option in Or the second option - global body-parser settings in |
parseJson is not used in body.... Okay I have fixed this issue in #119 . For having separate |
there is special options for this purpose in 0.7.0 now |
Hi @pleerock. Thank you for your work. Sorry but, I haven't figured out yet what is exactly the solution you came up with for solving this issue. Would you be kind and please explain to me what are those "special options in 0.7.0" you mentioned before that could stop "routing-controllers" to load "bodyParser.json()" with empty options?. |
Hi @pleerock . routing-controllers is really great work. Thanks you for developing this piece of software. I have the same issue as the topic creator. I post images as base64 and with createExpressServer() I am not able to update the limits of bodyParser. Tried to switch to useExpressServer() but then all of my requests just dont get answered anymore in case of an error (e.g. JWT expired). Using "authorizationChecker" and am returning a "UnauthorizedError" there. So I dont know how to make useExpressServer() work for me to have the same behaviour as createExpressServer() and I dont see a chance to use createExpressServer() without the information how to configure bodyParser correctly. Desperately need your help here. Would be awesome if you could elaborate on your latest statement from 22 May 2017, what kind of option you have integrated. Thanks in advance. EDIT: After some research and debugging I found out that you have added a property "options: any" in the BodyOptions of the Action (Decorator) @Body. Used it like that EDIT2: Sorry for spaming. Guess I figured it out. Needed to pass an object to it like this: |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm trying to set a "limit" with the body parser library (using express) and it is not working due to that the "routing-controller" loads the
bodyParser.json()
with empty options.example:
This is not working because the bodyParser is called first with empty options by "JsonController" or "JsonResponse" decorators.
The text was updated successfully, but these errors were encountered: