New issue
Advanced search Search tips

Issue 671799 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Remove or internalize net::HttpUtil::AssembleRawHeaders()

Project Member Reported by eroman@chromium.org, Dec 6 2016

Issue description

net::HttpUtil::AssembleRawHeaders() is an awkward function which aggregates continued header lines, and normalizes line endings. It re-writes the input such that \0 (NUL) is used as the canonical line separator.

In practice today we consume response headers through HttpResponseHeaders using a pattern like:

new net::HttpResponseHeaders(
    net::HttpUtil::AssembleRawHeaders(headers.data(), headers.length()));

At a minimum we should internalize this as an intermediate representation managed by HttpResponseHeaders.

Even better would be if we can get rid of the NUL re-write internally and make things more efficient and general.

IIRC, historically this function existed as a bridge layer -- we would get header lines from WinHTTP as \0 separated goop of text and the rest of the stack operated on this. This design constraint is no longer applicable, and HttpResponseHeaders is the interface to use.

Preliminary concerns with this transition are:

 * Dependencies on the format for serialization
 * If we end up now allowing embedded NULs in headers, that may expose other problems in parsing code that assumed c-strings (i.e. truncation)
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d19397cc2a4a905de4b7ace96f2dfb6b0e88ef59

commit d19397cc2a4a905de4b7ace96f2dfb6b0e88ef59
Author: eroman <eroman@chromium.org>
Date: Fri Dec 09 01:48:16 2016

Update a TODO to point to the relevant bug.

BUG=671799

Review-Url: https://codereview.chromium.org/2559593002
Cr-Commit-Position: refs/heads/master@{#437424}

[modify] https://crrev.com/d19397cc2a4a905de4b7ace96f2dfb6b0e88ef59/net/http/http_util.h

Labels: -Type-Feature Network-Triaged Type-Task
Components: Internals>Network
Components: -Internals>Network>HTTP
Status: Available (was: Untriaged)

Sign in to add a comment