1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(ext/http): panic on Response.error()

This commit is contained in:
Satya Rohith 2022-05-03 17:03:24 +05:30
parent de2004dec5
commit 303a1c4127
No known key found for this signature in database
GPG key ID: B2705CF40523EB05

View file

@ -506,7 +506,9 @@ async fn op_http_write_headers(
let mut etag_header = None; let mut etag_header = None;
let mut content_type_header = None; let mut content_type_header = None;
builder.headers_mut().unwrap().reserve(headers.len()); if let Some(h) = builder.headers_mut() {
h.reserve(headers.len())
};
for (key, value) in &headers { for (key, value) in &headers {
if key.eq_ignore_ascii_case(b"cache-control") { if key.eq_ignore_ascii_case(b"cache-control") {
if let Ok(value) = std::str::from_utf8(value) { if let Ok(value) = std::str::from_utf8(value) {