Error while accessing a target resource

Hello, I'm trying to download a simple code on the STM32L151CCU6 and I'm taking errors like: No Algorithm found for: 08000000H - 08001393H Erase skipped!

This discussion has been locked.

You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hello, I’m trying to download a simple code on the STM32L151CCU6
and I’m taking errors like:

 No Algorithm found for: 08000000H - 08001393H
Erase skipped!
Error: Flash Download failed  -  "Cortex-M3"
Flash Load finished at 17:45:40
Load "Test_1.2\Test_1.2"
Error: Flash Download failed  -  Target DLL has been cancelled
Flash Load finished at 17:46:18
Load "Test_1.2\Test_1.2"
No Algorithm found for: 08000000H - 08001393H
Erase skipped!
Error: Flash Download failed  -  "Cortex-M3"
Flash Load finished at 17:46:20
Load "Test_1.2\Test_1.2"
No Algorithm found for: 08000000H - 08001393H
Erase skipped!
Error: Flash Download failed  -  "Cortex-M3"
Flash Load finished at 17:46:25
Load "Test_1.2\Test_1.2"
Error: Flash Download failed  -  Target DLL has been cancelled
Flash Load finished at 17:53:34
Load "Test_1.2\Test_1.2"
No Algorithm found for: 08000000H - 08001393H
Erase skipped!
Error: Flash Download failed  -  "Cortex-M3"
Flash Load finished at 17:54:19

About the Algorithm I added "STM32L1xx 256k" and just changed the start address (0x40000000) and size (0x0800) and that seemed to take the error away.
But still I'm having the error of "Flash Download failed  -  "Cortex-M3"" and some times times "Error: Flash Download failed  -  Target DLL has been cancelled".

Does anybody know what I can do? I have tried things from searching on google but until now nothing worked.


Parents

  • cOSankalp Agarwal

    Your flash algo is not correct.

    The start address of algo should be 08000000H and the size should
    be as per the error message, So untill 08001393H

    May be you can choose more generic size for ex. 0x2000H

Reply

  • cOSankalp Agarwal

    Your flash algo is not correct.

    The start address of algo should be 08000000H and the size should
    be as per the error message, So untill 08001393H

    May be you can choose more generic size for ex. 0x2000H

Children

Сообщения без ответов | Активные темы

ПРЯМО СЕЙЧАС:

Автор Сообщение

Не в сети

Заголовок сообщения: Cannot access target При старте отладке.

СообщениеДобавлено: Сб май 14, 2016 12:42:13 

Поставщик валерьянки для Кота
Аватар пользователя

Карма: 11

Рейтинг сообщений: 26

Зарегистрирован: Вс июн 26, 2011 20:03:21
Сообщений: 2305

Рейтинг сообщения: 0

Здравствуйте!
Возникла проблема с отладкой проекта на STM32F3Discovery. Проект — Virtual COM Port на USB скачан отсюда: http://microtechnics.ru/mikrokontroller-stm32-i-usb/ (ссылка на проект в конце статьи). Иногда отладка запускается нормально и все работает, но после некоторого количества таких запусков вылетает ошибка

Цитата:

Cannot access target. Shutting down debug session.

и больше запустить отладку не получается. Если выполнять код построчно, то ошибка не появляется. Я уже и частоты в отладчике крутил, и under Reset выставил, и пробовал на Keil 5 проект запускать (сам проект запилен под Keil 4), и от администратора запускал — но все безрезультатно. Иногда, сама по себе отладка начинает работать, но опять после некоторого количества таких запусков вылетает ошибка.
Подскажите пожалуйста, что делать, а то у меня уже варианты кончились :dont_know:

Вернуться наверх
 

ПрофильПрофиль

 

Реклама

dosikus

Не в сети

Заголовок сообщения: Re: Cannot access target При старте отладке.

СообщениеДобавлено: Вс май 15, 2016 08:11:10 

Друг Кота
Аватар пользователя

Карма: 30

Рейтинг сообщений: 154

Зарегистрирован: Пн июл 28, 2008 22:12:01
Сообщений: 3604

Рейтинг сообщения: 0

Вернуться наверх
Реклама

isx

Не в сети

Заголовок сообщения: Re: Cannot access target При старте отладке.

СообщениеДобавлено: Вс май 15, 2016 12:25:03 

Поставщик валерьянки для Кота
Аватар пользователя

Карма: 11

Рейтинг сообщений: 26

Зарегистрирован: Вс июн 26, 2011 20:03:21
Сообщений: 2305

Рейтинг сообщения: 0

Но некоторые проекты работают нормально. Плюс, если отключить Кейл и подключить устройство к компу, то оно нормально определяется и работает… :dont_know:

Вернуться наверх

dosikus

Не в сети

Заголовок сообщения: Re: Cannot access target При старте отладке.

СообщениеДобавлено: Вс май 15, 2016 14:15:38 

Друг Кота
Аватар пользователя

Карма: 30

Рейтинг сообщений: 154

Зарегистрирован: Пн июл 28, 2008 22:12:01
Сообщений: 3604

Рейтинг сообщения: 0

Только что увидел ссылку. :))) Я бы с таких ресурсов поостерегся что-либо брать. :))) :)))
Сплошные танцы с бубном, все на грани фола …

Вернуться наверх
Реклама

Выгодные LED-драйверы для решения любых задач

КОМПЭЛ представляет со склада и под заказ широкий выбор LED-драйверов производства MEAN WELL, MOSO, Snappy, Inventronics, EagleRise. Линейки LED-драйверов этих компаний, выполненные по технологии Tunable White и имеющие возможность непосредственного встраивания в систему умного дома (димминг по шине KNX), перекрывают практически полный спектр применений: от простых световых указателей и декоративной подсветки до диммируемых по различным протоколам светильников внутреннего и наружного освещения.

Подобрать LED-драйвер>>

isx

Не в сети

Заголовок сообщения: Re: Cannot access target При старте отладке.

СообщениеДобавлено: Вс май 15, 2016 14:45:28 

Поставщик валерьянки для Кота
Аватар пользователя

Карма: 11

Рейтинг сообщений: 26

Зарегистрирован: Вс июн 26, 2011 20:03:21
Сообщений: 2305

Рейтинг сообщения: 0

Почему? Я с помощью этого ресурса вообще начал работать с СТМ. Жаль только там сплош все в SPL.. :(

Вернуться наверх
Реклама

Реклама

LIMF – источники питания High-End от MORNSUN со стандартным функционалом на DIN-рейку

На склад Компэл поступили ИП MORNSUN (крепление на DIN-рейку) с выходной мощностью 240 и 480 Вт. Данные источники питания обладают 150% перегрузочной способностью, активной схемой коррекции коэффициента мощности (ККМ; PFC), наличием сухого контакта реле для контроля работоспособности (DC OK) и возможностью подстройки выходного напряжения. Источники питания выполнены в металлическом корпусе, ПП с компонентами покрыта лаком с двух сторон, что делает ее устойчивой к соляному туману и пыли. Изделия соответствуют требованиям ANSI/ISA 71.04-2013 G3 на устойчивость к коррозии, а также нормам ATEX для взрывоопасных зон.

Подробнее>>

Кто сейчас на форуме

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 6

Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

SQLEXCEPTION ENCOUNTERED WHILE ACCESSING THE TARGET DATA SOURCE

Web Sep 15, 2022 This has been resolved — It was actually a Network Issue pertains to NAT Loopback. The network I have been working on does not support NAT Loopback — …
From stackoverflow.com


ERROR WHILE ACCESSING A RESOURCE IN APM : MISSING … — DEVCENTRAL

Web Dec 4, 2022 Hi All, We have View VDI set up with our F5 APM, and when I try to connect I can login with my AD credentials and when I try to access a resource via HTML I
From community.f5.com


ERROR OCCURED WHILE ACCESSING TARGET DISK DRIVE PARTITION

Web Feb 22, 2021 Related Posts. NBRT FILE FAILS TO START WHEN BOOTING FROM USB DRIVE; Norton Bootable Recovery Tool video glitch; Rufus 3.17 & nbrt.iso will not boot …
From community.norton.com


GATEWAY ERROR — UNABLE TO REFRESH OR CONNECT — POWER BI

Web Nov 30, 2017 12-11-2017 01:29 AM. Please make sure the credential you typed in gateway configuration still has access to data resource. If data connection is Ok, and …
From community.powerbi.com


PENDING — ERROR: UNABLE TO ACCESS TARGET MACHINE FOR REQUEST …

Web Nov 8, 2022 ERROR: Unable to access target machine for request: «2097152274», machine name: «VDI11», access denied or invalid network path. Sort by date Sort by …
From forums.prajwaldesai.com


ERROR FETCHING STATUS. ERROR WHILE ACCESSING DATAS… — GOOGLE CLOUD …

Web Mar 16, 2016 Let me know your email, I can provision new org with same email address, PM me your email address using «Ask An Expert» button on right side bar.
From googlecloudcommunity.com


RESOLVE USER_ERROR: «ERROR WHILE ACCESSING A RESOURCE» …

Web Web Services > USER_ERROR: Please configure the inventory detail in line 2 of the Item List SuiteTalk REST Web Services Overview and Setup «Notice (SuiteScript) Your …
From jcurvesolutions1.zendesk.com


GETTING ERROR MESSAGE WHEN TRYING TO ACCESS A SHARED …

Web So open explorer, select Tools -> Map Network Drive, enter your preferred drive letter, and the UNC path\Ayour_shared_folder, and click on «Connect using a different user …
From answers.microsoft.com


ERROR 10830 ACCESSING THE TARGET DATABASE — PROGRESS …

Web Mar 25, 2014 Restart replication server and agent so that they can re-establish connection and synchronise the target database with the source database: 1.) The Replication …
From community.progress.com


HELP WITH KEIL MDK DEBUGGER. STM32F072. — ST COMMUNITY

Web Pavel A. (Customer) Edited November 16, 2018 at 3:40 AM. Keil support reply is that Cortex M0 and M0+ do not have DWT, so using DWT clock with their EVR always was a bug, …
From community.st.com


ERROR: «PERMISSION DENIED WHILE ACCESSING THE TARGET …

Web May 18, 2022 Rich resources to help you leverage full capabilities of our products. … ERROR: «Permission denied while accessing the target folder [PR_EDJCA_B]» while …
From knowledge.informatica.com


SOLVED: ACCESS TO THE RESOURCE IS FORBIDDEN ERROR WHILE …

Web Jan 12, 2022 Solved: Hi, I am creating user Activity panel and want to use following API to get worklspaces, datasets, dataflows etc —
From powerusers.microsoft.com


STM32L476 ERROR: FLASH DOWNLOAD FAILED — «CORTEX-M4»

Web Dec 16, 2021 Continuing the discussion from STM32L476 Error: Flash Download failed — «Cortex-M4»: We think the problem is related to the “Flash Download” settings available …
From forums.mbed.com


解决ERROR WHILE ACCESSING A TARGET RESOURCE. RESOURCE IS …

Web Mar 9, 2022 最近在使用VSCode,其中遇到了一些坑,便在此做一些解决的记录。我使用的编译器是MinGw。第一个坑:按下F5运行时提示如下: 文字版提示为: Unable to start …
From blog.csdn.net


ERROR: «PERMISSION DENIED WHILE ACCESSING THE TARGET …

Web May 18, 2022 TARGET_FOLDER_MAPPING — Folder we would import the mapping under. FOLDER_SHORTCUT — Conatins the source objects for the shortcuts used in the …
From knowledge.informatica.com


[SOLVED] AN ERROR OCCURRED WHILE ACCESSING THE RESOURCES

Web Jul 5, 2022 To enable the method: Open the IIS Management Console on the web server. Expand the Sites folder. Double-Click the IIS — Authentication option. Under …
From 9to5answer.com


AZURE SSAS GATEWAY CONNECTION ISSUE — RECEIVED ERROR PAYLOAD …

Web Aug 25, 2020 Unable to create analysis services resource. Changing analysis service tier from S1 to B1. In Analysis Services, turning the AlwaysUseGateway property True/False. …
From learn.microsoft.com


ERRORS WHILE TRYING DOWNLOADING CODE — KEIL FORUM — SUPPORT …

Web Feb 21, 2018 Resource perhaps not available or a wrong access was attempted. Error: Flash Download failed — «Cortex-M3» Flash Load finished at 09:52:03 Load …
From community.arm.com


SYNC ERROR WHILE SAVING ACTIVITY IN TARGET | ADOBE EXPERIENCE CLOUD

Web Examples of types of sync errors: Size of HTML Custom offer. Because of URLs, especially the src attribute value in img html tags. URLs not accessible, restricted, or broken. …
From experienceleague.adobe.com


AN ERROR OCCURRED WHILE ACCESSING THIS RESOURCE. RETRY THE …

Web Jun 15, 2021 confirmed port 443 is enabled, contacted to the rdbroker from sessionhost C:UserslocaladminDownloadsPSTools>psping
From techcommunity.microsoft.com


I have NOT worked on Java, SpringBoot and Maven a lot. I had gone through several posts for the issue mentioned above, but nothing was close to my scenario

I compile and package SpringBoot project using Maven with JDK1.8.0_172 on Windows 10

I then deploy this packaged war to Linux server (RHEL with JDK1.8.0_201 and Tomcat 8)

When I hit the URL http://localhost:8080/MyApp, tomcat errors and I don’t see anything wrong in Tomcat logs

I am not sure what I am doing wrong. Any help is highly appreciated

Error from Tomcat Server

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

POM.xml file

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.htc.myapp.main</groupId>
  <artifactId>SpringProject</artifactId>
  <version>0.0.1-SNAPSHOT</version> 
  <properties>
    <java.version>1.8</java.version>
  </properties>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.4.RELEASE</version>
  </parent>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>


<dependency>
<groupId>com.bmc.remedy</groupId>
<artifactId>remedyapi</artifactId>
<version>8.1</version>
<scope>system</scope>
<systemPath>${basedir}/lib/remedyapi-8.1.jar</systemPath>
</dependency>

    <!-- JSTL tag lib -->
    <dependency>
      <groupId>javax.servlet.jsp.jstl</groupId>
      <artifactId>javax.servlet.jsp.jstl-api</artifactId>
      <version>1.2.1</version>
    </dependency>

    <dependency>
      <groupId>taglibs</groupId>
      <artifactId>standard</artifactId>
      <version>1.1.2</version>
    </dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-jpa -->
<!-- <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
</dependency> -->   

    <!-- Tomcat for JSP rendering -->
    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-jasper</artifactId>
      <scope>provided</scope>
    </dependency>

   <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>


             <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>4.3.8.RELEASE</version>
</dependency>

 <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.9</version>
        </dependency>


    <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.8.5</version>
        </dependency>



            <dependency>
            <groupId>net.sourceforge.jtds</groupId>
            <artifactId>jtds</artifactId>
            <version>1.3.1</version>
        </dependency>

    <dependency> 
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>

    <!-- <dependency>
            <groupId>net.sourceforge.jtds</groupId>
            <artifactId>jtds</artifactId>
            <version>1.3.1</version>
        </dependency> -->
    <!--    
    <dependency> 
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency> -->



    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.3</version>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency> 


<!-- <dependency> 
        <groupId>com.fasterxml.jackson.core</groupId> 
        <artifactId>jackson-databind</artifactId> 
        <version>2.5.3</version>  
</dependency>  -->



<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-client -->
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-client</artifactId>
    <version>1.19</version>
</dependency>

  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>



  </dependencies>

  <build>
  <finalName>MyApp</finalName>
    <plugins> 
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>


    <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>

            </plugin>

     </plugins>

  </build>
  <procedure><packaging>war</packaging></properties>
</project>

EDIT

I installed Tomcat 7 and was able to open the application. However, invoking some action on application throws ‘Something went wrong’

Looking into Tomcat logs it appears there’s some issue with DB connectivity

Error on Logs

2019-06-19 12:42:55.943 ERROR 20177 --- [bio-8080-exec-3] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.
java.sql.SQLException: No suitable driver found for jdbc:jtds:sqlserver://10.xxx.xxx.xxx:1433/MyDatabase;user=username;password=pwd

I copied jtds-1.3.1.jar to $TOMCAT_instance/lib directory and also tried used the following DB settings but NOTHING worked

db_LMS.url=jdbc:jtds:sqlserver://10.xxx.xxx.xxx:1433;databaseName=MyDatabase;integratedSecurity=true;user=username;password=pwd
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

        db_LMS.url=jdbc:jtds:sqlserver://10.xxx.xxx.xxx:1433/MyDatabase;user=username;password=pwd
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

Any help on this issue is highly appreciated

Cross-Origin Resource Sharing (

CORS) is a mechanism or a protocol that allows devices on one domain to access resources residing on other domains.

Generally, for security reasons, browsers forbid requests that come in from cross-domain sources. However, there could be cases where you want to overcome this and access cross-domain resources, and CORS makes this possible.

There is another concept known as

Same-Origin Policy (

SOP) which enables resource sharing on similar domains. In this guide, we will discuss the

SOP and how it helps to secure websites. We will also discuss how CORS extends the flexibility and adds pace to the SOP.

Same-Origin Policy (SOP)

The Same-Origin Policy was developed as a security mechanism for browsers to protect resources from malicious attacks. SOP allows resource sharing (data exchange) between two objects with the same origins.

This means that the origin of two websites should be the same if they want to share resources. For two websites to have the same origins, the websites should have the same domain, port number, and protocol type. If any one of these three properties is found different, then the sources are considered different origins.

While SOP is considered a restrictive system, it is highly secured, eliminating potential attacks on websites through cross-domain resources.

SOP offers security to websites but can also be a huddle to interact with third-party websites. Many dynamic websites regularly share a cross-domain resource with trusted websites and subdomains. 

With SOP in place, access to cross-origin websites is restricted, and controlled access to resources is possible using Cross-Origin Resource Sharing (CORS).

Cross-Origin Resource Sharing (CORS)

CORS was introduced to provide easy and quick access to subdomains and trusted third parties. CORS enables controlled resource sharing between cross-domain origins as discussed earlier.

The browser and cross-origin website you are trying to access collectively exchange HTTP headers that define trusted web origins and associated properties for access control, as defined by CORS specifications.

CORS offers controlled access to cross-domain websites and hence is well secured. CORS is widely implemented to tackle limitations introduced by SOP. However, if poorly executed, CORS can cause severe security risks. Improper configuration of CORS may present some challenges and errors.

Let us learn more about CORS errors and best practices to avoid them.

Understanding and Fixing CORS Error

CORS is implemented on the server-side; it cannot be reconfigured on the client-side. The CORS behavior, commonly termed as CORS error, is a mechanism to restrict users from accessing shared resources.

This is not an error but a security measure to secure users or the website which you are accessing from a potential security breach.

This breach may occur due to incomplete or improper HTTP headers on the client-side implementation (eg. missing authorization data such as API key).

Best Practices to Avoid CORS Errors

Let’s discuss some of the best practices for avoiding CORS errors by using a Custom Field Extension in Contentstack.

Proxy the API Request While Using External Calls in an Extension

CORS proxy can be a helpful solution to make cross-origin requests. The proxy layer sits between your request and its destination without knowing the request’s origin.

Thus, though the request comes from an unknown source, the CORS proxy makes it seem that it is a request from an allowed location.

To learn how to do this, here is the list of

CORS-Proxy which you can use for your website.

Free Proxies can be great for testing, but relying on a free third-party tool is not advisable for something you will use on the production site. In such cases, a more stable solution is to call the API from a server and make the data available on the client-side.

Use a Serverless Function

A more commonly used solution to resolve CORS error is to use a serverless function. It is an alternate way to proxy your requests, but instead of relying on a free third-party service, you can build your micro-infrastructure to call a web service and feed data to an API endpoint.

Popular serverless functions include AWS Lambda, Azure Functions, and Google Cloud functions. These services allow you to get just enough server space to run a function or two, as you do not need much space to run a function that calls a web service to return some data.

To understand this better, let’s consider a use case:

A user wants to create an extension in Contentstack which will fetch the maps data from the

Google Maps API to get data related to longitude and latitude within your entry.

The user has to follow the steps below:

  1. Create a custom extension in Contentstack using the UI extension SDK. This extension will make an API call to the Google Maps API to fetch the data in your entry.
    The request will fail due to the cross-origin policy set at Google’s server, which will not let you fetch the data, resulting in a CORS error at your client-side.
  2. To solve this problem, you can create an API Gateway URL in AWS with CORS enabled to serve the responses from the Google Maps API with our AWS Lambda function. For example:
     exports.handler = async (event) => {
    try{
    
        return {
          statusCode: 200,
          headers: {
            'Content-Type': 'application/json',
            'Access-Control-Allow-Headers':
              'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token',
            'Access-Control-Allow-Methods': 'OPTIONS,POST',
            'Access-Control-Allow-Credentials': true,
            'Access-Control-Allow-Origin': '*',
            'X-Requested-With': '*',
          },
          body: JSON stringified object,
        };
      } catch (error) {
        console.log(error);
        return {
          statusCode: 500,
          headers: {
            'Content-Type': 'application/json',
            'Access-Control-Allow-Headers':
              'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token',
            'Access-Control-Allow-Methods': 'OPTIONS,POST',
            'Access-Control-Allow-Credentials': true,
            'Access-Control-Allow-Origin': '*',
            'X-Requested-With': '*',
          },
          body: JSON.stringify({
            name: error.name,
            code: error.code,
            message: error.message,
          }),
        };
      }
    };
    
  3. The extension that we have created will make an appropriate call i.e., GET, POST, and so on, to our API Gateway URL & trigger our lambda function.
  4. The AWS Lambda will then return the maps API response to our client-side. This will fetch the maps data from Google Maps within your entry in Contentstack.

Note: For external hosting of the extension source code, the ‘allow-same-origin’ option will be enabled. Here, the origin refers to the domain where you’ve hosted the extensions. Also, ensure that the response header has the exact origin URL passed in the request header.
For Contentstack-hosted extensions, the iframe’s origin will be null as we don’t enable the ‘allow-same-origin’ flag.

CORS Issue in Frontend Frameworks

The CORS configuration can sometimes be tricky to achieve, and hence developers serve both the backend and frontend under the same domain in production.

To minimize this effort and provide flexibility to work with CORS, React, Nuxt, Express, etc. allow users to replicate the setup in development. This setup is done at the server end, so whenever a cross-origin request is made to the server, we can use a  middleware like http-proxy-middleware to proxy requests.

Furthermore, we can also redirect and change the path of the request by using options like pathRewrite.

Понравилась статья? Поделить с друзьями:
  • Error while accepting ssl connection error 02001003 system library fopen no such process
  • Error when trying to open audio device tonelib
  • Error when trying to open audio device minihost modular
  • Error when trying to open audio device light host
  • Error when trying to connect bad healthcheck status