401对ios的未经授权的响应,但在Android上运行良好

时间:2017-01-17 16:11:07

标签: ios angularjs cordova xmlhttprequest

最近我被要求在适用于Android和iOS的cordova中包装angularJS应用程序。 Angular app正在使用http请求使用cookie从服务器获取数据。

当我在cordova中包装app并将其部署在Android上时,一切正常(所有请求都有效)。不幸的是,iOS版本存在问题。 iOS上的相同项目使用cookie为每个请求弹出401错误。在跟踪网络信息时,请求中的标头是相同的。

对于带有cookie的http请求,Android和iOS之间的区别是什么?我是否需要专门针对iOS平台的某种附加配置?

编辑:我的config.xml:

...
<allow-navigation href="http://*/*" />
<allow-navigation href="*" />
<allow-intent href="https://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<engine name="android" spec="~5.2.2" />
<platform name="android">
    <plugin name="cordova-plugin-whitelist" spec="~1.2.2" />
    <plugin name="cordova-plugin-android-permissions" spec="~0.10.0" />
    <allow-intent href="market:*" />
    <allow-navigation href="*" />
</platform>
<platform name="ios">
    <access origin="*" />
    <allow-navigation href="*" />
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>
...

0 个答案:

没有答案