Skip to content

CORS error with "Origin file://" #12607

@mburger81

Description

@mburger81

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
On doing a post for example over "https://abc.page.com/login" from device (production mode) we got an "CORS" error because in the request there is a Origin header.
As described in a very old article http://blog.ionic.io/handling-cors-issues-in-ionic/, shouldn't there be no problem for an http request and handling CORS?

This is the created request header:

Request Headers
Provisional headers are shown
Accept:application/json, text/plain, */*
content-type:text/plain
Origin:file://
User-Agent:Mozilla/5.0 (Linux; Android 7.0; SM-G920F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Crosswalk/23.53.589.4 Mobile Safari/537.36

Should there be an origin??? If yes and if the maintainer of the service is checking for Origin we are not able to call any services checking this.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/..../web-client-ionic/node_modules)
    @ionic/cli-plugin-cordova       : 1.6.2
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0

global packages:
    Cordova CLI : 7.0.1 

local packages:
    @ionic/app-scripts : 2.1.3
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.0

System:
    Android SDK Tools : 26.0.2
    Node              : v6.11.1
    OS                : Linux 4.10
    npm               : 5.3.0 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions