Android- EXTRA_HEADERS无法反映在大于83的更新Chrome版本中 [英] Android- EXTRA_HEADERS is not reflecting in updated Chrome version greater than 83

查看:168
本文介绍了Android- EXTRA_HEADERS无法反映在大于83的更新Chrome版本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前传递给customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS,headers)的EXTRA_HEADERS正常运行. Chrome更新到83后,它停止传递标头数据.

Earlier the EXTRA_HEADERS passed to the customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers), was working fine. After Chrome updated to 83, it stopped passing the header data.

   public static void startCustomTab(String url, Context context) {
    CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
    CustomTabsIntent customTabsIntent = builder.build();
    builder.setShowTitle(true);
    Bundle headers = new Bundle();
    headers.putString(context.getString(R.string.type), "android");
    headers.putString(context.getString(R.string.source), "app");
    customTabsIntent.intent.putExtra(Browser.EXTRA_HEADERS, headers);
    customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    customTabsIntent.launchUrl(context, Uri.parse(url));
}

推荐答案

由于存在漏洞,删除了添加自定义标头的操作.仍然支持 CORS安全列出的请求标头.您可以在此处了解有关此更改的更多信息: http://crbug.com/873178

Adding custom headers was removed due to being a vulnerability. CORS safe-listed request headers are still supported. You can read more about this change here: http://crbug.com/873178

这篇关于Android- EXTRA_HEADERS无法反映在大于83的更新Chrome版本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆