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

Bug report: Status 500 on content-length >197700 #31

Open
davepo opened this issue Feb 24, 2021 · 1 comment
Open

Bug report: Status 500 on content-length >197700 #31

davepo opened this issue Feb 24, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@davepo
Copy link

davepo commented Feb 24, 2021

Describe the bug
I get a status 500 every time I try submitting data > 197700. That's not a specific number, but just my closest frame of reference based on sources used.

To Reproduce
Attempt to bake with the following python function:

def query_cyberchef(source_data):
headers = {
'Content-Type': 'application/json',
}
encodedBytes = base64.urlsafe_b64encode(source_data.encode("utf-8"))
encodedStr = str(encodedBytes, "utf-8")
data = {"input":encodedStr, "recipe":[{ "op": "From Base64","args": ["A-Za-z0-9-_=", 'true'] },{ "op": "Remove whitespace","args": ['true', 'true', 'true', 'true', 'true', 'false'] },{ "op": "CTPH","args": [] }]}
response = requests.post('http://localhost:3000/bake', headers=headers, data=json.dumps(data))
return response

Expected behavior
I would expect a Status code 200 with the has as the CTPH in the response. This works on smaller files and I don't see anything other than the content-length that is different.

Node version:
14.15.5
Same results with 10.23.3

Additional context
Error: failed with status code 500
at ServerResponse.onResFinished (/home/redrobin/CyberChef-server/node_modules/pino-http/logger.js:51:33)
at ServerResponse.emit (events.js:327:22)
at ServerResponse.EventEmitter.emit (domain.js:467:12)
at onFinish (_http_outgoing.js:766:10)
at callback (internal/streams/writable.js:513:21)
at afterWrite (internal/streams/writable.js:466:5)
at afterWriteTick (internal/streams/writable.js:453:10)
at processTicksAndRejections (internal/process/task_queues.js:79:21)

@davepo davepo added the bug Something isn't working label Feb 24, 2021
@xxxbbbbs-dev
Copy link

To resolve this bug, you only need to change the app.use(express.json()) in the app.js file to ### app.use(express.json({ limit: '10mb' })); because the default request body size limit in Express is 100KB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants