Project

General

Profile

Support #8151

XMLHttpRequest error

Added by Alex Fedorov over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/26/2021
Due date:
% Done:

0%

Estimated time:

Description

I'm trying to add my Wt-based widget to an existing HTML page. I create and start a local server with default configuration file on my laptop and call

"hello.exe --http-address=127.0.0.1 --http-port=8080 --deploy-path=/hello --docroot=."

in html I write this:
///////////////////////////////////////////////////////////////////////////////////////////////////
....

<!-- End hidden fields for Wt's internal path API -->

<!--
We need a place holder for every widget to which we want to bind
a WContainerWidget in Wt
-->

<!--
As the last step, we load our application.
-->

///////////////////////////////////////////////////////////////////////////////////////////////////

The browser can't show my embedded widget with the following error:

Access to XMLHttpRequest at 'http://localhost:8080/hello.js?wtd=i7XwnllcOtORsO7n&wtt=widgetset' from origin 'null' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

How to fix it?


Files

config.jpg (31 KB) config.jpg Alex Fedorov, 02/26/2021 09:26 PM

Also available in: Atom PDF