Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27382] iOS: CORS Issue, origin of header is always null since SDK 8

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionNot Our Bug
Resolution Date2019-10-28T18:26:36.000+0000
Affected Version/sRelease 8.0.2, Release 8.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterShuo Liang
AssigneeUnknown
Created2019-09-06T10:48:24.000+0000
Updated2019-12-04T00:41:46.000+0000

Description

Problem Description:

As of SDK 8, any XMLHttpRequest performed inside a WebView from a file has a header of origin: null. This is a behavior that was not present in SDK 7 and only affects IOS. (It seems to be due to the change to WKWebview.) We use the WebView in an authentication workflow where we have an intermediate HTML file with the necessary javascript to perform the redirections/progress the sign in. This is an HTML page in resources/www. Due to the fact this header is now A) Being set for seemingly all requests, even GET B) is always null This is breaking our authentication process and we cannot continue developing our application until it is fixed. There does not appear to be any way to currently set this via titanium, there is also nothing in the documentation. We cannot set Access-Control-Allow-Origin * / null as this would pose a security risk server-side. We need to be able to switch back to using UIWebview in the new SDK, the origin header dropped, or, the origin header has a correct value (https://localhost/.....).

Reproduce

1. Create a new alloy projet. 2. Add attached file. 3. Run the app to iOS device 4. Monitor network traffic so you can see the request headers (as per screenshot attached).

Attachments

FileDateSize
index.tss2019-09-06T10:50:35.000+0000238
index.xml2019-09-06T10:50:20.000+000099
localfile.html2019-09-06T10:50:10.000+0000725
Screenshot_2019-09-06_at_10.08.41.png2019-09-06T10:53:40.000+0000263941

Comments

No comments

JSON Source