Cordova应用如何更改Android的ORIGIN标头值。

huangapple go评论68阅读模式
英文:

Cordova app how to change the Android ORIGIN header value

问题

在iOS中,我的应用程序的HTTP请求标头为Origin: ionic//myapp

在Android中,我的应用程序的HTTP请求标头为:Origin: http://localhost

我如何将Android的Origin值更改为类似iOS,或只列出我的应用程序名称?- localhost 似乎没有用。

英文:

In iOS, my app HTTP request headers have Origin: ionic//myapp

In Android, my app HTTP request headers are: Origin: http://localhost

How can I change the Android Origin value to be like iOS and/or just list my app name? - localhost seems useless.

答案1

得分: 1

我只会回答 Cordova 部分。由于您没有提到版本,不确定这对您是否适用。您可以在首选项中设置方案和主机名,例如

<preference name="scheme" value="https" />
<preference name="hostname" value="whatever" />
英文:

I will answer for Cordova only. Since you didn't mention the version, not sure this will work for you. You can set a scheme and hostname in preferences, such as

&lt;preference name=&quot;scheme&quot; value=&quot;https&quot; /&gt;
&lt;preference name=&quot;hostname&quot; value=&quot;whatever&quot; /&gt;

huangapple
  • 本文由 发表于 2023年3月3日 22:14:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75628187.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定