windows runtime - WinJS webpage inside webview returns 0x80070005 on ajax call that uses cors -
we have winjs apps shows web site inside webview control, webpage loads fine every ajax call fails 0x80070005 access denied error. tried adding "internet (client)", "internet (client/server)" , "private networks" capabilities app without success.
the calls use cors allow calling multiple domains, site is working fine on every desktop browser, on ie inside modern environment. however, when site running inside webview control, preflight request runs, despite server being responding status code 200, real request never being sent.
we can see using fiddler, here preflight request:
options /queries/querycontentareas/getavaliablecontentareas http/1.1 accept: */* origin: https://myapp.demo.es access-control-request-method: access-control-request-headers: accept, authorization ua-cpu: amd64 accept-encoding: gzip, deflate user-agent: mozilla/5.0 (windows nt 6.3; win64; x64; trident/7.0; msapphost/2.0; rv:11.0) gecko host: myappapi.demo.es content-length: 0 connection: keep-alive cache-control: no-cache
and here server's response:
http/1.1 200 ok server: microsoft-iis/8.0 access-control-allow-origin: https://myapp.demo.es access-control-allow-credentials: true access-control-allow-headers: authorization x-powered-by: asp.net date: thu, 29 may 2014 16:32:56 gmt content-length: 0
in visual studio access denied error appears:
script7002: xmlhttprequest: error de red 0x80070005, acceso denegado. file: demo
not sure if ever figured out or not, i'm running similar.
based on features , restrictions context (html) seems since app inside web context (because it's in webview) cross-domain xhr requests not allowed.
Comments
Post a Comment