New issue
Advanced search Search tips

Issue 772966 link

Starred by 13 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Chromium error when providing more than one header in an Android custom tabs intent

Reported by jsta...@onedrop.today, Oct 9 2017

Issue description

Device name: Nexus 5x

From "Settings > About Chrome"
Application version: 61.0.3163.98
Operating system: Android 8.0.0

URLs (if applicable):

Steps to reproduce:
(1) Create a CustomTabsIntent with > 1 header entry in the Browser.EXTRA_HEADERS bundle
(2) Fire the intent to open a chrome custom tab

Expected result:
All of the headers should get passed in the HTTP request


Actual result:
None of the headers appear to be included in the HTTP request. Chromium displays an error in logcat: "[ERROR:http_request_headers.cc(150)] "Accept-Language: en-US\nX-Parse-Session-Token: r:beb91fa37506df032c7880d9bd3c0b13" has invalid header value."

It looks like the headers are collapsed into a single string, separated by newline characters. Then the native HttpRequestHeader class checks that the value doesn't contain any newline characters using HttpUtil::IsValidHeaderValue.

I think it's using HttpRequestHeaders::AddHeaderFromString instead of HttpRequestHeaders::AddHeadersFromString when there are multiple headers provided.
 
Screen Shot 2017-10-09 at 11.45.08 AM.png
18.1 KB View Download
I guess there's no way for me to edit this bug report, but I think it might actually be splitting the string incorrectly in HttpRequestHeaders::AddHeadersFromString. It's splitting using the delimiter \r\n instead of \n.
Labels: Needs-triage-Mobile
Thanks for filing the issue. 

jstarke@ If possible please provide a reduced testcase for repro?
Sure! I think this is what you're looking for. Just click the button and you'll see this error in logcat:

10-09 16:34:12.781 27949-27949/? E/chromium: [ERROR:http_request_headers.cc(150)] "Cache-Control: no-cache
 Accept-Language: en-US" has invalid header value.
ChromeBugTest.zip
15.5 MB Download
Cc: rbasuvula@chromium.org ligim...@chromium.org
Components: Internals>Network
Labels: -Pri-3 Triaged-Mobile M-63 Pri-1 Type-Bug-Regression
Owner: kinuko@chromium.org
Status: Assigned (was: Unconfirmed)
Possible suspect: https://chromium-review.googlesource.com/c/chromium/src/+/633316

From chromium code search, seems like above patch is the suspect not sure though. Kinuko,would you mind confirming.


Comment 5 by kinuko@chromium.org, Oct 12 2017

Cc: kinuko@chromium.org
Components: UI>Browser>Mobile>CustomTabs
Owner: yus...@chromium.org
Status: Untriaged (was: Assigned)
I agree that my change looks to be suspicious (well) but I can't find where my change could wrongly add unparsed strings to the headers.

Calling AddHeaderFromString where AddHeadersFromString sounds like a plausible cause, but my change didn't add any and there's not much callsite for AddHeaderFromString.

Actually I don't really know what code path CCT is going through, if it's happening only on CCT there might be issues there?

yusufo@- would you be able to help triaging this or re-assigning this to someone familiar with what code path it goes through when Browser.EXTRA_HEADERS is specified?
Status: Assigned (was: Untriaged)
 Issue 770186  has been merged into this issue.

Sign in to add a comment