MCPcopy Create free account
hub / github.com/awslabs/llrt / is_http_header_name

Function is_http_header_name

modules/llrt_fetch/src/headers.rs:659–671  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

657 b'!' | b'#' | b'$' | b'%' | b'&' | b'\'' | b'*' | b'+' |
658 b'-' | b'.' | b'^' | b'_' | b'`' | b'|' | b'~' |
659 b'0'..=b'9' | b'A'..=b'Z' | b'a'..=b'z'
660 )
661 })
662}
663
664/// Check for bare CR or LF in the interior of the value (not leading/trailing)
665fn has_bare_cr_lf(value: &str) -> bool {
666 let trimmed = value.trim_matches(|c: char| c == ' ' || c == '\t' || c == '\n' || c == '\r');
667 trimmed.bytes().any(|b| b == b'\n' || b == b'\r')
668}
669fn is_http_header_value(value: &str) -> bool {
670 value.chars().all(|c| {
671 let cp = c as u32;
672 cp == 0x09 // HTAB
673 || cp == 0x0C // Form Feed
674 || (0x20..=0x7E).contains(&cp) // SP + VCHAR

Callers 7

appendMethod · 0.85
getMethod · 0.85
hasMethod · 0.85
setMethod · 0.85
deleteMethod · 0.85
from_valueMethod · 0.85
from_arrayMethod · 0.85

Calls 2

is_emptyMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected