Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Running Gateway inside Docker Container will not allow to send HTTP GET request with custom headers in browser #85

Open
Salman-Arshad opened this issue Jun 24, 2021 · 0 comments

Comments

@Salman-Arshad
Copy link

Salman-Arshad commented Jun 24, 2021

Problem

I am trying to send custom headers request-public-key and x-request-signature to https://<gateway>/<trxId>. from chrome

Tried Solutions

I tried to add cors so that it can accept Cross-Site requests with Custom headers (mentioned above). Refer to Pull Request
This fixed the problem potentially i.e when running the container without docker via yarn start or npm run dev:start but when the gateway is running inside a docker container via sudo docker container up --build -d it will give CORS issue on the browser.

STR

To reproduce the problem

  1. start the gateway from v0.12.1 via sudo docker container up --build -d
  2. send a GET request to https://<gateway>/<trxId> from bowser and append some custom headers like
headers":{
  "key1":"value1"
}

  1. You will get CORS issue.

To Potentially fix the problem

  1. start the gateway from v0.12.1 via yarn start or npm run dev:start
  2. send a GET request to https://<gateway>/<trxId> from bowser and append some custom headers like
headers":{
  "key1":"value1"
}
  1. You will get 200

Concerns

My main concern is that why when ran without docker it works and gives 200 and when ran without containerizing the application it works just fine

Environment

Docker Version: Docker version 20.10.7, build f0df350
Docker-compose version: docker-compose version 1.29.2, build 5becea4c
OS:Ubuntu 20.04 LTS

@Salman-Arshad Salman-Arshad changed the title Running Gateway inside Docker Container will not allow to send HTTP GET request with custo headers Running Gateway inside Docker Container will not allow to send HTTP GET request with custom headers in browser Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant