def redirect.body

bend-kit-http@0.38.4.0 · http.bend:1777

import bend-kit-http@0.38.4.0/http.bend as Http
import 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

Uses (3)

Used by (1)