prism icon indicating copy to clipboard operation
prism copied to clipboard

truncate sl-violations when it would be too long

Open EdVinyard opened this issue 3 years ago • 0 comments

Context

In proxy mode when there are many contract violations, the sl-violations response header may exceed size limitations and cause failures in proxies and clients.

See https://github.com/stoplightio/prism/pull/2126 for context.

Expected Behavior

The sl-violations response header never exceeds a length that will cause errors in proxies and clients.

Solution

The sl-violations header is automatically truncated at a length less than common server limits (8KB). Start at https://github.com/24i/prism/blob/master/packages/http-server/src/server.ts#L104

EdVinyard avatar Sep 02 '22 16:09 EdVinyard