Skip to main content
1007

Invalid Frame Payload Data

Sent by: BothDo not retry

1007 Invalid Frame Payload Data is sent when a text message frame contains data that is not valid UTF-8. WebSocket text frames (opcode 0x1) are required to contain valid UTF-8. If binary data is accidentally sent as a text frame, or encoding is wrong, the receiver sends 1007.

Description

WebSocket text frames must contain valid UTF-8 encoded data. If an endpoint sends a text frame with invalid UTF-8 sequences, the peer closes with 1007. This is distinct from 1003 (wrong type) – 1007 means the correct frame type was used but the content is not valid UTF-8. Common cause: passing raw bytes as a text message, or Latin-1/ISO-8859-1 characters outside the ASCII range without proper UTF-8 encoding.

Common Causes

  • Text frame containing non-UTF-8 bytes
  • Latin-1 encoded string sent as UTF-8 text frame
  • Accidental binary data in text frame

Code

1007

RFC

RFC 6455

Sent By

Both

Retry

No