New issue
Advanced search Search tips

Issue 801487 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 23
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Not able to set HTTP headers in Trusted Web Activities

Reported by markst3v...@gmail.com, Jan 12 2018

Issue description

Steps to reproduce the problem:
1.  Using Android support lib 27.0.2 setup a Chrome CustomTabsIntent with an extra for a single HTTP header:

Bundle headers = new Bundle();
headers.putString("testing", "Hello");
customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers);

2. Launch it as a Trusted Web Activity:

TrustedWebUtils.launchAsTrustedWebActivity(activity, customTabsIntent, Uri.parse(url));

3. The HTTP header does not end up in the request. I have verified this server side and by launching it as a normal custom tab (in that case it sends the header). 

I know there is an existing bug (772966) for multiple headers but a single header should still work.

The documentation at https://developers.google.com/web/updates/2017/10/using-twa says "...you can coordinate with the web content by passing data to and from the page in URLs (e.g. through query parameters, custom HTTP headers..."

What is the expected behavior?
HTTP header is sent in the Trusted Web Activity request

What went wrong?
HTTP header is not sent in the Trusted Web Activity request

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 65.0.3318.0  Channel: canary
OS Version: 8.1.0
Flash Version: N/A
 
Components: UI>Browser>Mobile>CustomTabs
Cc: ligim...@chromium.org pnangunoori@chromium.org
Labels: Needs-Feedback
If the issue still persist, please provide a reduced testcase for triaging.
Still happening in Chrome Canary 67.0.3382.0 for Android. Not sure what else I can provide other than whats in the first post. The HTTP header is just not sent in the request.
Project Member

Comment 4 by sheriffbot@chromium.org, Mar 28 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback
markst3v3ns@ -- As it is the custom tabs related, if you can provide any sample application or sample apk file through which issue can be reproduced and will help us in reproducing the issue along with the screen cast for the better understanding of the issue.

Thanks in advance!

Comment 6 by bauerb@chromium.org, Apr 24 2018

Cc: peconn@chromium.org

Comment 7 by bauerb@chromium.org, Apr 24 2018

Labels: -Needs-Feedback
Status: Available (was: Unconfirmed)
Ah, CustomTabActivity.loadUrlInTab() sets the headers on the LoadUrlParams (via IntentHandler.addReferrerAndHeaders()), but WebAppActivity.onNewIntent() does not.

Comment 8 by peconn@chromium.org, May 11 2018

Owner: amalova@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 16

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

commit b85d821e5c072c7123ff77be8c614446a1b9286d
Author: Anna Malova <amalova@chromium.org>
Date: Mon Jul 16 16:43:53 2018

set HTTP header from the intent in TWA

Bug:  801487 
Change-Id: Ic7aca7b7b497e4040e311b06ee5d8912fd416404
Reviewed-on: https://chromium-review.googlesource.com/1116219
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Anna Malova <amalova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575304}
[modify] https://crrev.com/b85d821e5c072c7123ff77be8c614446a1b9286d/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Status: Fixed (was: Assigned)
Project Member

Comment 11 by bugdroid1@chromium.org, Oct 19

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

commit a81e05221c77039e3cec7a7294c7dce7e29a5a45
Author: Peter Kotwicz <pkotwicz@chromium.org>
Date: Fri Oct 19 16:23:36 2018

[Android WebAPK] Ignore com.android.browser.headers intent extra for Webapps and WebAPKs

This CL removes the handling of the com.android.browser.headers intent extra in
WebappActivity. The handling was added in
https://chromium-review.googlesource.com/c/chromium/src/+/1116219
at the time that TWAs used WebappActivity. They no longer do so.

BUG=871266,  801487 

Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Ife40f882f45900f33ff356c435ee1a9283a4419e
Reviewed-on: https://chromium-review.googlesource.com/c/1288012
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Peter Conn <peconn@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601176}
[modify] https://crrev.com/a81e05221c77039e3cec7a7294c7dce7e29a5a45/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Sign in to add a comment