cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lorcan Lai (JIRA)" <>
Subject [jira] [Commented] (CB-13639) The fetch request has a cross-origin problem
Date Fri, 08 Dec 2017 03:31:00 GMT


Lorcan Lai commented on CB-13639:

Thank you for [~Sujan12]'s answer. As you said,I needs to add the following header to its
response on server-side?

Access-Control-Allow-Origin: *

This can be solved.
But what I don't understand is,
# cordova uses the file:// protocol(Phonegap wiki says:"The cross-domain security policy does
not affect PhoneGap applications. Since the html files are called by webkit with the file://
protocol, the security policy does not apply."),Why did this happen,and I must to set CORS
config on server-side?In some cases,because of the security policy, we can't change this part
of the server-side Settings.
# I had no problem using Ajax or XMLHttpRequest APIs,why?

> The fetch request has a cross-origin problem
> --------------------------------------------
>                 Key: CB-13639
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>         Environment: # cordova6/cordova7
> # 华为(HUAWEI)畅享5S Android5.1.1
>            Reporter: Lorcan Lai
>              Labels: cross-origin, fetch
> I used [fetch]( to request
a service,report "...cross-origin..." problem. And then I try to use Ajax or XMLHttpRequest
to request the same service,there's no problem.
> a part of the content in my config.xml, 
> {code:xml}
> <access origin="*">
> <allow-navigation href="http://*/*" />
> <allow-navigation href="https://*/*" />
> <allow-navigation href="data:*" />
> {code}
> Cordova is not good for the fetch request?

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message