def redirect.body
import bend-kit-http@0.38.2.0/http.bend as Httpimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
1777# 303 turns any method but HEAD into GET; 301 and 302 turn POST into GET;
1778# 307 and 308 keep method and body. A GET carries no body or body headers.
1779# Credentials do not follow a hop to another origin.
1780def redirect.body(drop: Bool, body: Bytes.Bytes) -> Bytes.Bytes:
1781 match drop:
1782 case True{}:
1783 Bytes.new(0)
1784 case False{}:
1785 body