net: DumpWithoutCrashing for invalid header name
Add a temporary DumpWithoutCrashing for when an invalid header key is set. This is to debug crbug.com/1028189 where a header key fails to deserialize correctly. Bug: 1028189 Change-Id: I8848f1b4b78363b56babd787d73f24f8c11dec3c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401278 Reviewed-by: Matt Menke <mmenke@chromium.org> Commit-Queue: Bo <boliu@chromium.org> Cr-Commit-Position: refs/heads/master@{#805369}
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/strcat.h"
|
||||
@ -106,6 +107,10 @@ void HttpRequestHeaders::Clear() {
|
||||
|
||||
void HttpRequestHeaders::SetHeader(const base::StringPiece& key,
|
||||
const base::StringPiece& value) {
|
||||
// TODO(crbug.com/1028189): Adding temporarily to debug crbug.com/1028189.
|
||||
if (!HttpUtil::IsValidHeaderName(key)) {
|
||||
base::debug::DumpWithoutCrashing();
|
||||
}
|
||||
// Invalid header names or values could mean clients can attach
|
||||
// browser-internal headers.
|
||||
DCHECK(HttpUtil::IsValidHeaderName(key)) << key;
|
||||
|
Reference in New Issue
Block a user