def line.parts

bend-kit-websocket@0.4.0.0 · websocket.bend:141

import bend-kit-websocket@0.4.0.0/websocket.bend as Websocket
import Base

141# A header line is name ":" value, with a non-empty name that holds no space or tab
142# (RFC 9112 §5.1). That rules out obsolete line folding and bare text.
143def line.parts(parts: List<&2, String>) -> Bool:
144  match parts:
145    case Con{+k, Con{v, rest}}:
146      Bool.and(Bool.not(String.is_empty(k)), Bool.not(Bool.or(String.contains(k, " "), String.contains(k, "\t"))))
147    case _:
148      False{}

Uses (8)

Used by (1)