DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
API Development Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
API Development
A code review finds a WebSocket handler that does JSON.parse(data) directly on incoming message data. What's the risk?
A
No risk — JSON.parse always works on any input
B
data is a Buffer, not a string — JSON.parse on a Buffer may behave unexpectedly or require an explicit .toString() first depending on the exact usage, matching this topic's confirmed Buffer gotcha
C
This is only a risk for binary WebSocket frames
D
JSON.parse cannot ever be used with WebSocket data
Check Answer