@postya

Как исправить ошибку в консоли браузера "Access to XMLHttpRequest?

Использкю Spring Boot и Thymeleaf.
На одной странице у меня отображаются видео с ютуба. Всё работает нормально, но когда я зашёл в инструменты разработчика, в консоли браузера(brave), то увидел эти ошибки. В разных браузерах то же самое показывает .

Стоит ли уделять внимание этим ошибкам? Эти ошибки вроде ни на что не влияют, контент подгружается нормально.

Можно ли как-то исправить хотя бы одну из ошибок? например :

Access to XMLHttpRequest at 'https://googleads.g.doubleclick.net/pagead/id' from origin 'https://www.youtube.com' 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


HTML:

<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Video Tutorials</title>
    <link rel="stylesheet" th:href="@{/css/main.css}">
    <link rel="stylesheet" th:href="@{css/fontawesome/all.min.css}">
    <link rel="stylesheet" th:href="@{css/header.css}">
    <link rel="stylesheet" th:href="@{css/tutorials.css}">
    <link rel="stylesheet" th:href="@{/css/animate/animate.css}">
</head>
<body>


<div class="container animated fadeIn">

    <!-- NAVIGATION MENU-->
    <div th:replace="fragments/navbar :: navbar">

    </div>

    <!--CONTENT=====================-->
    <div class="video-container">
        <div class="video-item" th:each="video : ${videos}">
            <iframe th:src="${video.url}"
                    allowfullscreen></iframe>
            <h3 th:text="${video.title}"></h3>
        </div>
        
    </div>

</div>

</body>
</html>


5e8f4327130c9890119106.jpeg
  • Вопрос задан
  • 2048 просмотров
Пригласить эксперта
Ответы на вопрос 1
azerphoenix
@azerphoenix Куратор тега Spring
Java Software Engineer
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы