DependencyTrack / DependencyTrack/dependency-track
CORS error when navigating to components functionality with CORS Disabled??? (Docker-compose installation with default docker-compose.yml)
- 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

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
Assessment
This issue has not been assessed yet.