DependencyTrack / DependencyTrack/dependency-track

CORS error when navigating to components functionality with CORS Disabled??? (Docker-compose installation with default docker-compose.yml)

Open
#984 8 comments 0 reactions 0 assignees View on GitHub
cannot reproduce
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
8h 39m
Merged PRs (30d)
237

Description

Dear,

we recently started with the installation of dependencytrack with the use of docker and docker compose
I noticed that cors is default enabled on the components functionality.
Even do we did not explicitly set cors with any environment setting.

I configured the docker compose file with the default information from the website
only adjusted the
**API_BASE_URL=http://bcco-sca01.domain.local:8081**
on the front end part

![issue dependencytrack](https://user-images.githubusercontent.com/29273350/112440843-13d93e00-8d4b-11eb-9dbc-c34d6afb2732.PNG)

IF i navigate to the components page i get an cors error

Access to XMLHttpRequest at 'http://bcco-sca01.domain.local:8081/api/v1/component/identity?sortOrder=asc&pageSize=10&pageNumber=1' from origin 'http://bcco-sca01.domain.local:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Request URL: http://bcco-sca01.domain.local:8081/api/v1/component/identity?sortOrder=asc&pageSize=10&pageNumber=1
Referrer Policy: strict-origin-when-cross-origin
Connection: close
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: nl-BE,nl-NL;q=0.9,nl;q=0.8,en-US;q=0.7,en;q=0.6,fr;q=0.5,de;q=0.4
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6IkRlcGVuZGVuY3ktVHJhY2siLCJpYXQiOjE2MTY2NTk4OTMsImV4cCI6MTYxNzI2NDY5MywicGVybWlzc2lvbnMiOiJBQ0NFU1NfTUFOQUdFTUVOVCxCT01fVVBMT0FELFBPTElDWV9NQU5BR0VNRU5ULFBPTElDWV9WSU9MQVRJT05fQU5BTFlTSVMsUE9SVEZPTElPX01BTkFHRU1FTlQsUFJPSkVDVF9DUkVBVElPTl9VUExPQUQsU1lTVEVNX0NPTkZJR1VSQVRJT04sVklFV19QT1JURk9MSU8sVlVMTkVSQUJJTElUWV9BTkFMWVNJUyxBQ0NFU1NfTUFOQUdFTUVOVCxCT01fVVBMT0FELFBPTElDWV9NQU5BR0VNRU5ULFBPTElDWV9WSU9MQVRJT05fQU5BTFlTSVMsUE9SVEZPTElPX01BTkFHRU1FTlQsUFJPSkVDVF9DUkVBVElPTl9VUExPQUQsU1lTVEVNX0NPTkZJR1VSQVRJT04sVklFV19QT1JURk9MSU8sVlVMTkVSQUJJTElUWV9BTkFMWVNJUyIsImlkcCI6IkxPQ0FMIn0.T1u_Wamn4ELd-jiH7JfS5rC1RoQxBBIs1QElT6NOOOo
Connection: keep-alive
Content-Type: application/json
Host: bcco-sca01.domain.local:8081
**Origin: http://bcco-sca01.domain.local:8080**
Referer: http://bcco-sca01.domain.local:8080/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
sortOrder: asc
pageSize: 10
pageNumber: 1

Could you please check if this is default behaviour or bug
Kind regards,
Ben

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.