Questions tagged cors

Explore the latest questions and answers asked by our top developers.

Docker running amazon/aws-lambda-nodejs JSON errors

Issue: Running into this error within Docker lambda logs …ERROR Invoke Error {"errorType":"SyntaxError", "errorMessage":"Unexpected end of JSON input","stack": ["SyntaxError: Unexpected end of JSON input"," at JSON.parse (<anonymous>)"," at Runtime.handleOnce (/var/runtime/Runtime.js:67:14)"]} When using a fetch: … await fetch(url, requestOptions) .then(function (response) { if (response.ok) { return response.json(); } return false; }); Called via this simplified request […]

By theMidwest
Published
Categorised as cors, docker, lambda, node.js, webpack Tagged , , , ,

Docker running amazon/aws-lambda-nodejs Invoke errors

Issue: Running into this error within Docker lambda logs …ERROR Invoke Error {"errorType":"SyntaxError", "errorMessage":"Unexpected end of JSON input","stack": ["SyntaxError: Unexpected end of JSON input"," at JSON.parse (<anonymous>)"," at Runtime.handleOnce (/var/runtime/Runtime.js:67:14)"]} When using a fetch: … await fetch(url, requestOptions) .then(function (response) { if (response.ok) { return response.json(); } return false; }); Called via this simplified request […]

By theMidwest
Published
Categorised as cors, docker, lambda, node.js, webpack Tagged , , , ,

I get CORS policy when request frontend container to backend container

I have two projects on ubuntu server. I have a React and Spring Boot project running as a container. I expose frontend like 3000:3000 but I don’t want to expose my backend project. I just want it to access from the react container. I run my images like Spring Boot: docker run -d registry.gitlab.com/my-backend-project React: […]

By nyavuzcan
Published
Categorised as containers, cors, docker, reactjs, spring-boot Tagged , , , ,

Problem CORS with spring security in Docker

I have an application front end developed with angular 11.2.1, and a backend developed with spring boot 2.5.2. Spring security is well integrated. I encountered the problem of CORS [ No ‘Access-Control-Allow-Origin’ header is present on the requested resource ], locally and I solved it by adopting a global solution with spring security. All works […]

By imane
Published
Categorised as backend, cors, docker, frontend, spring-security Tagged , , , ,

Nginx reverse proxy from localhost to deployed website

I have a development frontend with Angular that ask for data in http://localhost:80/api/v1/data/foo. The API is already deployed in a server, and I’d like to be able to do a reverse proxy to still sending request to localhost, but getting the data from the actual deployed server. I have my Angular app dockerized, so I’m […]

By Jacobo
Published
Categorised as cors, docker, nginx, nginx-reverse-proxy Tagged , , ,

CORS "Access-Control-Allow-Credentials", "Access-Control-Allow-Origin" response headers appear for local but not docker container

can anyone help me solve this issue? I’m running a php Laravel backend with fortify and sanctum for auth. I also have a React frontend which makes api calls to this backend, both of these are dockerized. If I run the php server locally, there are no issues with CORs. But once the backend is […]

By Obelisk the CORs Mentor
Published
Categorised as cors, docker, laravel, nginx, node.js Tagged , , , ,

How to enable cors on FastAPI + Unicorn + Docker

I’m trying to set the cors for my api and any address is approved! I even exaturated with google.com just to be sure that it’s not a local problem. This is my code: from typing import Optional from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware app = FastAPI(debug=True) # UnicornMiddleware(app, some_config="rainbow") origins = [ # […]

By W Doch
Published
Categorised as cors, docker, docker-build, fastapi, unicorn Tagged , , , ,

Why do I get CORS problems between Docker Containers

I’m creating a small webApp inside of a docker environment. Here’s the compose file: version: ‘3’ services: ## Webserver web: image: nginx:latest depends_on: – mysql – php volumes: – ./www:/var/www/html – ./nginx:/etc/nginx/conf.d/ ports: – "8080:80" ## PHP-fpm php: build: ./php volumes: – ./www:/var/www/html – ./php:/usr/local/etc/php/php.ini ## MySQL mysql: image: mysql:5.7 restart: always environment: – MYSQL_DATABASE=db […]

By MaxB
Published
Categorised as cors, docker, php, preflight Tagged , , ,

SPRING CORS Response to preflight request doesn’t pass access control

i’m very new to SPRING but not so much with CORS experience. I have a web app that is running on localhost:3000 and a spring service running in localhost:8080. the method initDGCI is the one that i can’t reach i found some guides on how to edit my controller but none of them worked. Here […]

By lorenzo
Published
Categorised as cors, docker, maven, spring Tagged , , ,

Magento Docker ReactJS CORS issue

I am using Markshust Docker image on my local machine to setup magento 2.2.x project and it works fine. The frontend of my website is a ReactJS app which consumes Magento REST APIs. It is working on our server environments, but on my local machine with the above mentioned setup I am getting CORS error […]

By Abid Malik
Published
Categorised as cors, docker, magento2.2, reactjs Tagged , , ,
1 6

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq