Skip to main content

parse_guc_headers

Function parse_guc_headers 

Source
pub fn parse_guc_headers(guc_headers: &str) -> Option<Vec<(String, String)>>
Expand description

Parse the response.headers setting a function may have set.

PostgREST’s shape: a JSON array of objects, each with exactly one key and a string value. An array rather than one object because a response may carry the same header twice – two Set-Cookies, say – which an object cannot express.

Err when it is anything else, which is a fault in the function rather than in the request and is reported as one.