Table of Contents

Property SkipSubjectValidation

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

SkipSubjectValidation

Gets or sets a value indicating whether to skip subject validation. The default is false, meaning subject validation is enabled.

public bool SkipSubjectValidation { get; init; }

Property Value

bool

Remarks

When set to false (default), subjects are validated to ensure they are not empty and don't contain whitespace characters (space, tab, CR, LF). This prevents CRLF protocol injection where a subject containing \r\n could inject arbitrary NATS commands.

When set to true, all subject validation is bypassed for maximum throughput. Only use this if you fully control all subject strings and can guarantee they never contain whitespace or CRLF sequences.