使用angular2应用程序使用Azure blob存储和Azure代理功能
我将角度应用程序“dist”文件夹上传到Azure blob存储。
我可以从blob中运行index.html,它会运行应用程序。
现在,我想创建一些Azure代理函数,它将重定向到此Blob并运行角度应用程序。
但是当我运行这个代理,我得到异常:使用angular2应用程序使用Azure blob存储和Azure代理功能
error_handler.js:48 EXCEPTION: Uncaught (in promise): SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'StorageUrl/ContainerName/' cannot be created in a document with origin 'FunctionUrl' and URL 'FunctionUrl/ContainerName'. Error: Failed to execute 'replaceState' on 'History': A history state object with URL 'StorageUrl/ContainerName/' cannot be created in a document with origin 'FunctionUrl' and URL 'FunctionUrl/ContainerName'.
有谁看到了这个错误?
我能够重现更多关于Angular问题的错误。该official doc说:
The router uses the browser's history.pushState for navigation. Thanks to
pushState
, you can make in-app URL paths look the way you want them to look, e.g.localhost:3000/crisis-center
. The in-app URLs can be indistinguishable from server URLs.
而且从Mozilla pushState documentation:
The new URL must be of the same origin as the current URL; otherwise, pushState() will throw an exception.