Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Jun 5, 2024
1 parent d6af6c0 commit 9b51558
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/canyon-backend/src/upload/raw-body.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import * as bodyParser from 'body-parser';
@Injectable()
export class RawBodyMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: NextFunction) {
bodyParser.json()(req, res, (errJson) => {
// Set the limit to 100MB for JSON and raw text bodies
const limit = '100mb';
bodyParser.json({ limit })(req, res, (errJson) => {
if (errJson) {
// Handle JSON parsing error
console.error('Error parsing JSON:', errJson);
}

bodyParser.raw({ type: 'text/plain' })(req, res, (errRaw) => {
bodyParser.raw({ type: 'text/plain', limit })(req, res, (errRaw) => {
if (errRaw) {
// Handle raw text parsing error
console.error('Error parsing raw text:', errRaw);
Expand Down
2 changes: 1 addition & 1 deletion packages/canyon-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
debug

node ~/Desktop/github/canyon-project/canyon/packages/canyon-cli/dist/bin/canyon.js --url http://localhost:8080
node ~/github.com/canyon-project/canyon/packages/canyon-cli/dist/bin/canyon.js --url http://localhost:8080

git tag -a v0.0.5 -m "Version 0.0.5"

Expand Down

0 comments on commit 9b51558

Please sign in to comment.