UWP built with cordova and Ionic don't take hosts file into account

0

I am building an application with cordova and Ionic for Windows UWP. When I run this code

this.http.post('htpp://myDomain.com/path/', data).toPromise().then(() => { ... });

It enters in the catch clause returning a response with 0 status.

I get this warning too, I don't know if it's related :

CONSOLE21301: serviceWorker.getRegistrations is rejected due to unsecure context or host restriction in ms-appx-web://microsoft.microsoftedge/assets/errorpages/dnserror.html?ErrorStatus=0x800C0005

My hosts file

127.0.0.1       localhost myDomain.com

Has someone an idea to fix this ?

Thanks By advance

cordova
ionic-framework
uwp
hosts
asked on Stack Overflow Sep 24, 2019 by Amanite Laurine • edited Sep 24, 2019 by Amanite Laurine

1 Answer

0

I finally found !

running this command allows the uwp app to run requests to local servers !

CheckNetIsolation.exe LoopbackExempt -a -n="[app PackageFullName]"
answered on Stack Overflow Sep 24, 2019 by Amanite Laurine

User contributions licensed under CC BY-SA 3.0