/// every header sent to `wrangler dev` must be prefixed
/// before sending it along to the preview service
/// so it is sent along to the Workers runtime and not
/// consumed directly by the preview service
every header sent to `wrangler dev` must be prefixed
before sending it along to the preview service
so it is sent along to the Workers runtime and not
consumed directly by the preview service
every header sent to ` wrangler dev ` must be prefixed before sending it along to the preview service so it is sent along to the Workers runtime and not consumed directly by the preview service
fn prepend_request_headers_prefix(parts: &mut RequestParts) {
    let mut headers: HeaderMap = HeaderMap::new();
    for header in &parts.headers {
        let (name, value) = header;
        let forward_header = format!("{}{}", HEADER_PREFIX, name);
        let header_name = HeaderName::from_bytes(forward_header.as_bytes())
            .unwrap_or_else(|_| panic!("Could not create header name for {}", name));
        headers.insert(header_name, value.clone());
    }
    parts.headers = headers;
}
fn prepend_request_headers_prefix ( parts : & mut RequestParts ) { let mut headers : HeaderMap = HeaderMap :: new ( ) ; for header in & parts . headers { let ( name , value ) = header ; let forward_header = format ! ( " " HEADER_PREFIX name ) ; let header_name = HeaderName :: from_bytes ( forward_header . as_bytes ( ) ) . unwrap_or_else ( | _ | panic ! ( " " name ) ) ; headers . insert ( header_name , value . clone ( ) ) ; } parts . headers = headers ; }
every header sent to `wrangler dev` must be prefixed
before sending it along to the preview service
so it is sent along to the Workers runtime and not
consumed directly by the preview service
every header sent to ` wrangler dev ` must be prefixed before sending it along to the preview service so it is sent along to the Workers runtime and not consumed directly by the preview service
parts
&mut RequestParts