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

需要可配置bodyParser的limit #37

Open
qjekingstar opened this issue Apr 13, 2019 · 1 comment
Open

需要可配置bodyParser的limit #37

qjekingstar opened this issue Apr 13, 2019 · 1 comment

Comments

@qjekingstar
Copy link

默认的是100k, 希望能改成可配置的,谢谢

let bodyParserMethd = bodyParser.json({ limit });
const contentType = req.get('Content-Type');
if (contentType === 'text/plain') {
	bodyParserMethd = bodyParser.raw({limit,  type: 'text/plain' });
} else if (contentType === 'text/html') {
	bodyParserMethd = bodyParser.text({limit, type: 'text/html' });
} else if (contentType === 'application/x-www-form-urlencoded') {
	bodyParserMethd = bodyParser.urlencoded({ limit, extended: false });
}
jaywcjlove added a commit that referenced this issue Apr 15, 2019
@jaywcjlove
Copy link
Owner

@qjekingstar Upgrade + [email protected]

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

2 participants