prism
prism copied to clipboard
truncate sl-violations when it would be too long
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