law tunnel_rejects_early_bytes

bend-kube-runtime@0.2.0.0 · LAWS.bend:291

import bend-kube-runtime@0.2.0.0/LAWS.bend as LAWS
import Base
import bend-kube-runtime@0.2.0.0/src/utf8.bend as U
import bend-kube-runtime@0.2.0.0/src/proxy.bend as P

291# Bytes after the proxy's answer, before we spoke TLS, fail the tunnel:
292# nothing the proxy says may become part of the TLS stream.
293law tunnel_rejects_early_bytes:
294  for b: U32
295  for bs: List<&2, U32>
296  {P.Tunnel.feed(P.Tunnel.init(),
297    List.append(&2, U32, U.Utf8.encode("HTTP/1.1 200 OK\r\n\r\n"), b <> bs))
298    == P.TFail{"proxy sent bytes before the TLS handshake"} : P.Tunnel}

Uses (7)

Used by (0)

No other definition uses this definition.