fix: incorrect Content-Disposition serialization (#31669)
* fix: incorrect Content-Disposition serialization * test: fixup test
This commit is contained in:
parent
31e877515c
commit
24b02d68a7
2 changed files with 5 additions and 3 deletions
|
@ -133,8 +133,10 @@ v8::Local<v8::Value> HttpResponseHeadersToV8(
|
|||
net::HttpContentDisposition header(value, std::string());
|
||||
std::string decodedFilename =
|
||||
header.is_attachment() ? " attachment" : " inline";
|
||||
decodedFilename += "; filename=" + header.filename();
|
||||
value = decodedFilename;
|
||||
// The filename must be encased in double quotes for serialization
|
||||
// to happen correctly.
|
||||
std::string filename = "\"" + header.filename() + "\"";
|
||||
value = decodedFilename + "; filename=" + filename;
|
||||
}
|
||||
if (!values)
|
||||
values = response_headers.SetKey(key, base::ListValue());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue